diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml
index 363111a26c0a9c..be2d372e88c177 100644
--- a/.github/workflows/examples-k32w.yaml
+++ b/.github/workflows/examples-k32w.yaml
@@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'
container:
- image: ghcr.io/project-chip/chip-build-k32w:32
+ image: ghcr.io/project-chip/chip-build-k32w:33
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
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 6b99456496d22a..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 \
@@ -197,7 +196,7 @@ jobs:
- name: Check for incorrect error use in VerifyOrExit
if: always()
run: |
- git grep -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
+ git grep -I -n "VerifyOrExit(.*, [A-Za-z]*_ERROR" -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -205,7 +204,7 @@ jobs:
- name: Check for use of PRI*8, which are not supported on some libcs.
if: always()
run: |
- git grep -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
+ git grep -I -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -213,7 +212,7 @@ jobs:
- name: Check for use of PRI*16, which are not supported on some libcs.
if: always()
run: |
- git grep -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
+ git grep -I -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -226,7 +225,7 @@ jobs:
# TODO: TLVDebug should ideally not be excluded here.
# TODO: protocol_decoder.cpp should ideally not be excluded here.
# TODO: PersistentStorageMacros.h should ideally not be excluded here.
- git grep -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
+ git grep -I -n "PRI.64" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)examples/chip-tool' ':(exclude)examples/tv-casting-app' ':(exclude)src/app/MessageDef/MessageDefHelper.cpp' ':(exclude)src/app/tests/integration/chip_im_initiator.cpp' ':(exclude)src/lib/core/TLVDebug.cpp' ':(exclude)src/lib/dnssd/tests/TestTxtFields.cpp' ':(exclude)src/lib/format/protocol_decoder.cpp' ':(exclude)src/lib/support/PersistentStorageMacros.h' ':(exclude)src/messaging/tests/echo/echo_requester.cpp' ':(exclude)src/platform/Linux' ':(exclude)src/platform/Ameba' ':(exclude)src/platform/ESP32' ':(exclude)src/platform/webos' ':(exclude)zzz_generated/chip-tool' ':(exclude)src/tools/chip-cert/Cmd_PrintCert.cpp' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -261,7 +260,7 @@ jobs:
- name: Check for use of 0x%u and the like, which lead to misleading output.
if: always()
run: |
- git grep -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
+ git grep -I -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -269,7 +268,7 @@ jobs:
- name: Check for use of '"0x" PRIu*' and the like, which lead to misleading output.
if: always()
run: |
- git grep -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
+ git grep -I -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match.
@@ -285,7 +284,7 @@ jobs:
- name: Check for use of 'emberAfReadAttribute' instead of the type-safe getters
if: always()
run: |
- git grep -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
+ git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -295,7 +294,7 @@ jobs:
- name: Check for use of 'emberAfWriteAttribute' instead of the type-safe setters
if: always()
run: |
- git grep -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
+ git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
# Run python Linter (flake8) and verify python files
# ignore some style errors, restyler should do that
@@ -310,7 +309,7 @@ jobs:
- name: Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should probably be "SuccessOrExit(err = CHIP_ERROR_*)"
if: always()
run: |
- git grep -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
+ git grep -I -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -318,4 +317,4 @@ jobs:
- name: Check for use of "SuccessOrExit(something-without-assignment(", which should probably be "SuccessOrExit(err = something("
if: always()
run: |
- git grep -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
+ git grep -I -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index bd9ac282b78a79..05d2670edd665e 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -500,7 +500,7 @@ jobs:
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_FAN_3_5.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-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_2_1.py" --script-args "--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_IDM_1_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-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_IDM_1_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"'
+ 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 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_IDM_1_4.py" --script-args "--hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --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-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_IDM_4_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-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_RR_1_1.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-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_RVCCLEANM_1_2.py" --script-args "--int-arg PIXIT_ENDPOINT:1 --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"'
@@ -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/nxp/lib/pw_rpc/BUILD.gn b/config/nxp/lib/pw_rpc/BUILD.gn
new file mode 100644
index 00000000000000..05962da9299912
--- /dev/null
+++ b/config/nxp/lib/pw_rpc/BUILD.gn
@@ -0,0 +1,38 @@
+# 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.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/pigweed.gni")
+import("$dir_pw_build/target_types.gni")
+
+static_library("pw_rpc") {
+ output_name = "libPwRpc"
+
+ public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ]
+ deps = [
+ "$dir_pw_rpc:server",
+ "$dir_pw_rpc/nanopb:echo_service",
+ "${chip_root}/examples/platform/nxp/pw_sys_io:pw_sys_io_nxp",
+ "${dir_pigweed}/pw_hdlc:pw_rpc",
+ dir_pw_assert,
+ dir_pw_hdlc,
+ dir_pw_log,
+ ]
+
+ deps += pw_build_LINK_DEPS
+
+ output_dir = "${root_out_dir}/lib"
+
+ complete_static_lib = true
+}
diff --git a/config/nxp/lib/pw_rpc/pw_rpc.gni b/config/nxp/lib/pw_rpc/pw_rpc.gni
new file mode 100644
index 00000000000000..68255db8bb96da
--- /dev/null
+++ b/config/nxp/lib/pw_rpc/pw_rpc.gni
@@ -0,0 +1,28 @@
+# 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.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/pigweed.gni")
+
+pw_log_BACKEND = "$dir_pw_log_basic"
+pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
+pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
+pw_sys_io_BACKEND = "${chip_root}/examples/platform/nxp/pw_sys_io:pw_sys_io_nxp"
+
+pw_build_LINK_DEPS = [
+ "$dir_pw_assert:impl",
+ "$dir_pw_log:impl",
+]
+
+dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
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/tizen/chip-gn/platform/BUILD.gn b/config/tizen/chip-gn/platform/BUILD.gn
index bea16af373fd15..7d2f25e9bcf4f8 100644
--- a/config/tizen/chip-gn/platform/BUILD.gn
+++ b/config/tizen/chip-gn/platform/BUILD.gn
@@ -20,10 +20,6 @@ import("${chip_root}/config/tizen/chip-gn/args.gni")
import("${build_root}/config/linux/pkg_config.gni")
import("${chip_root}/src/platform/device.gni")
-pkg_config("capi-system-peripheral-io") {
- packages = [ "capi-system-peripheral-io" ]
-}
-
pkg_config("dlog") {
packages = [ "dlog" ]
}
@@ -73,7 +69,6 @@ source_set("tizen") {
":glib",
":capi-appfw-preference",
":capi-system-info",
- ":capi-system-peripheral-io",
]
if (chip_mdns == "platform") {
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/ConcentrationMeasurement.xml b/data_model/clusters/ConcentrationMeasurement.xml
index c5e2971406f676..4b51cffa124321 100644
--- a/data_model/clusters/ConcentrationMeasurement.xml
+++ b/data_model/clusters/ConcentrationMeasurement.xml
@@ -261,4 +261,4 @@ Davis, CA 95616, USA
-
+
\ No newline at end of file
diff --git a/data_model/clusters/DemandResponseLoadControl.xml b/data_model/clusters/DemandResponseLoadControl.xml
index 170cde68e8acff..a5322bfb4f7206 100644
--- a/data_model/clusters/DemandResponseLoadControl.xml
+++ b/data_model/clusters/DemandResponseLoadControl.xml
@@ -248,17 +248,14 @@ Davis, CA 95616, USA
-
-
-
@@ -266,13 +263,11 @@ Davis, CA 95616, USA
-
-
@@ -286,7 +281,6 @@ Davis, CA 95616, USA
-
@@ -294,7 +288,6 @@ Davis, CA 95616, USA
-
@@ -302,7 +295,6 @@ Davis, CA 95616, USA
-
@@ -310,7 +302,6 @@ Davis, CA 95616, USA
-
diff --git a/data_model/clusters/DeviceEnergyManagement.xml b/data_model/clusters/DeviceEnergyManagement.xml
index 6d6477cc72fb7c..21f74a737d52cb 100644
--- a/data_model/clusters/DeviceEnergyManagement.xml
+++ b/data_model/clusters/DeviceEnergyManagement.xml
@@ -130,10 +130,10 @@ Davis, CA 95616, USA
- -
+
-
- -
+
-
@@ -237,13 +237,13 @@ Davis, CA 95616, USA
- -
+
-
- -
+
-
- -
+
-
@@ -257,36 +257,31 @@ Davis, CA 95616, USA
-
- -
+
-
-
-
-
-
-
@@ -294,181 +289,146 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -477,7 +437,6 @@ Davis, CA 95616, USA
-
@@ -486,7 +445,6 @@ Davis, CA 95616, USA
-
@@ -498,7 +456,6 @@ Davis, CA 95616, USA
-
diff --git a/data_model/clusters/DiagnosticsGeneral.xml b/data_model/clusters/DiagnosticsGeneral.xml
index 3ea1b41fc62a75..072d75d64acc31 100644
--- a/data_model/clusters/DiagnosticsGeneral.xml
+++ b/data_model/clusters/DiagnosticsGeneral.xml
@@ -58,9 +58,14 @@ Davis, CA 95616, USA
-
+
+
+
+
+
+
-
@@ -176,40 +181,32 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
@@ -289,6 +286,33 @@ Davis, CA 95616, USA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data_model/clusters/ElectricalEnergyMeasurement.xml b/data_model/clusters/ElectricalEnergyMeasurement.xml
index bcf229c0266009..c6bf8e73863c41 100644
--- a/data_model/clusters/ElectricalEnergyMeasurement.xml
+++ b/data_model/clusters/ElectricalEnergyMeasurement.xml
@@ -67,50 +67,21 @@ Davis, CA 95616, USA
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
@@ -120,17 +91,7 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
-
+
@@ -140,7 +101,7 @@ Davis, CA 95616, USA
-
+
@@ -150,47 +111,7 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -200,122 +121,57 @@ Davis, CA 95616, USA
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
diff --git a/data_model/clusters/ElectricalPowerMeasurement.xml b/data_model/clusters/ElectricalPowerMeasurement.xml
index 996fb0ce59ec11..aa5baeaf368cbb 100644
--- a/data_model/clusters/ElectricalPowerMeasurement.xml
+++ b/data_model/clusters/ElectricalPowerMeasurement.xml
@@ -59,238 +59,151 @@ Davis, CA 95616, USA
-
+
-
+
-
+
-
+
-
+
-
+
-
- -
-
-
- -
-
-
- -
+
+
-
- -
+
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
- -
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
-
+
-
+
+
-
+
-
+
-
+
+
-
+
-
+
-
+
+
-
+
-
+
-
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
-
+
@@ -299,7 +212,7 @@ Davis, CA 95616, USA
-
+
@@ -308,51 +221,28 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/data_model/clusters/EnergyCalendar.xml b/data_model/clusters/EnergyCalendar.xml
index 0f9cf3c087ecf8..a21845d92c47c4 100644
--- a/data_model/clusters/EnergyCalendar.xml
+++ b/data_model/clusters/EnergyCalendar.xml
@@ -195,9 +195,21 @@ Davis, CA 95616, USA
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data_model/clusters/EnergyEVSE.xml b/data_model/clusters/EnergyEVSE.xml
index c788edc054ede0..f59d41807d43e6 100644
--- a/data_model/clusters/EnergyEVSE.xml
+++ b/data_model/clusters/EnergyEVSE.xml
@@ -227,12 +227,10 @@ Davis, CA 95616, USA
-
-
@@ -241,7 +239,6 @@ Davis, CA 95616, USA
-
@@ -277,19 +274,19 @@ Davis, CA 95616, USA
-
+
-
+
-
+
@@ -297,7 +294,7 @@ Davis, CA 95616, USA
-
+
@@ -421,11 +418,11 @@ Davis, CA 95616, USA
-
+
-
+
@@ -439,7 +436,7 @@ Davis, CA 95616, USA
-
+
@@ -512,7 +509,7 @@ Davis, CA 95616, USA
-
+
diff --git a/data_model/clusters/EnergyPreference.xml b/data_model/clusters/EnergyPreference.xml
index fa50bbe839ae65..7156be8eafe025 100644
--- a/data_model/clusters/EnergyPreference.xml
+++ b/data_model/clusters/EnergyPreference.xml
@@ -85,11 +85,9 @@ Davis, CA 95616, USA
-
-
diff --git a/data_model/clusters/EnergyPrice.xml b/data_model/clusters/EnergyPrice.xml
index b358e75ab53a5c..23072a6a99ead5 100644
--- a/data_model/clusters/EnergyPrice.xml
+++ b/data_model/clusters/EnergyPrice.xml
@@ -113,15 +113,12 @@ Davis, CA 95616, USA
-
-
-
@@ -129,35 +126,28 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
diff --git a/data_model/clusters/Group-Key-Management-Cluster.xml b/data_model/clusters/Group-Key-Management-Cluster.xml
index ad86b24e3bd387..43e7a395ac8467 100644
--- a/data_model/clusters/Group-Key-Management-Cluster.xml
+++ b/data_model/clusters/Group-Key-Management-Cluster.xml
@@ -87,16 +87,13 @@ Davis, CA 95616, USA
-
-
-
diff --git a/data_model/clusters/ICDManagement.xml b/data_model/clusters/ICDManagement.xml
index f138e7037687b6..3cc6c9bfab4416 100644
--- a/data_model/clusters/ICDManagement.xml
+++ b/data_model/clusters/ICDManagement.xml
@@ -79,11 +79,11 @@ Davis, CA 95616, USA
-
+
-
+
@@ -185,7 +185,7 @@ Davis, CA 95616, USA
-
+
@@ -197,7 +197,7 @@ Davis, CA 95616, USA
-
+
diff --git a/data_model/clusters/Messages.xml b/data_model/clusters/Messages.xml
index a976e7d260f0ff..9dd223d9a63f46 100644
--- a/data_model/clusters/Messages.xml
+++ b/data_model/clusters/Messages.xml
@@ -193,35 +193,35 @@ Davis, CA 95616, USA
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -248,10 +248,32 @@ Davis, CA 95616, USA
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,4 +284,44 @@ Davis, CA 95616, USA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data_model/clusters/ModeBase.xml b/data_model/clusters/ModeBase.xml
index 1e6a81807e29a2..5774a7fec0c5a5 100644
--- a/data_model/clusters/ModeBase.xml
+++ b/data_model/clusters/ModeBase.xml
@@ -70,29 +70,24 @@ Require at least one standard mode tag. Define reserved ranges for base/derived
-
-
-
-
-
diff --git a/data_model/clusters/ModeSelect.xml b/data_model/clusters/ModeSelect.xml
index 2fff860458f0e5..19fe502c1fcfe2 100644
--- a/data_model/clusters/ModeSelect.xml
+++ b/data_model/clusters/ModeSelect.xml
@@ -69,29 +69,24 @@ Davis, CA 95616, USA
-
-
-
-
-
diff --git a/data_model/clusters/Mode_DeviceEnergyManagement.xml b/data_model/clusters/Mode_DeviceEnergyManagement.xml
index dc28204cecb511..4181b9b60ead42 100644
--- a/data_model/clusters/Mode_DeviceEnergyManagement.xml
+++ b/data_model/clusters/Mode_DeviceEnergyManagement.xml
@@ -62,30 +62,10 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data_model/clusters/OccupancySensing.xml b/data_model/clusters/OccupancySensing.xml
index 1dd5cbe6156865..d52f118b70cbde 100644
--- a/data_model/clusters/OccupancySensing.xml
+++ b/data_model/clusters/OccupancySensing.xml
@@ -55,11 +55,12 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
+
@@ -159,12 +160,10 @@ Davis, CA 95616, USA
-
-
diff --git a/data_model/clusters/PowerSourceConfigurationCluster.xml b/data_model/clusters/PowerSourceConfigurationCluster.xml
index b2eb27fd4bd7cc..5548bf6ad8e6b5 100644
--- a/data_model/clusters/PowerSourceConfigurationCluster.xml
+++ b/data_model/clusters/PowerSourceConfigurationCluster.xml
@@ -59,7 +59,7 @@ Davis, CA 95616, USA
-
+
diff --git a/data_model/clusters/PowerTopology.xml b/data_model/clusters/PowerTopology.xml
new file mode 100644
index 00000000000000..c8d90baeeded19
--- /dev/null
+++ b/data_model/clusters/PowerTopology.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data_model/clusters/ResourceMonitoring.xml b/data_model/clusters/ResourceMonitoring.xml
index 9772efbd429982..17fc7554ac41f0 100644
--- a/data_model/clusters/ResourceMonitoring.xml
+++ b/data_model/clusters/ResourceMonitoring.xml
@@ -116,12 +116,10 @@ Davis, CA 95616, USA
-
-
@@ -171,4 +169,4 @@ Davis, CA 95616, USA
-
+
\ No newline at end of file
diff --git a/data_model/clusters/Scenes.xml b/data_model/clusters/Scenes.xml
index 2168c164a02460..0c4347c4e8be8a 100644
--- a/data_model/clusters/Scenes.xml
+++ b/data_model/clusters/Scenes.xml
@@ -1,59 +1,59 @@
-
@@ -73,50 +73,39 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
-
@@ -146,24 +135,22 @@ Davis, CA 95616, USA
-
-
+
-
+
-
+
-
diff --git a/data_model/clusters/Thermostat.xml b/data_model/clusters/Thermostat.xml
index b7e811bb8738ae..400d55a048a116 100644
--- a/data_model/clusters/Thermostat.xml
+++ b/data_model/clusters/Thermostat.xml
@@ -451,27 +451,16 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
+
-
-
@@ -701,7 +690,7 @@ Davis, CA 95616, USA
-
+
@@ -742,7 +731,7 @@ Davis, CA 95616, USA
-
+
@@ -772,7 +761,7 @@ Davis, CA 95616, USA
-
+
@@ -898,7 +887,7 @@ Davis, CA 95616, USA
-
+
diff --git a/data_model/clusters/WaterContentMeasurement.xml b/data_model/clusters/WaterContentMeasurement.xml
index bca3f6de8e4101..8b1ff6a9a049bc 100644
--- a/data_model/clusters/WaterContentMeasurement.xml
+++ b/data_model/clusters/WaterContentMeasurement.xml
@@ -87,4 +87,4 @@ Davis, CA 95616, USA
-
+
\ No newline at end of file
diff --git a/data_model/clusters/Mode_Laundry.xml b/data_model/clusters/WiFiNetworkManagement.xml
similarity index 78%
rename from data_model/clusters/Mode_Laundry.xml
rename to data_model/clusters/WiFiNetworkManagement.xml
index 63108a01aa876b..6308eca7e4b184 100644
--- a/data_model/clusters/Mode_Laundry.xml
+++ b/data_model/clusters/WiFiNetworkManagement.xml
@@ -55,38 +55,31 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data_model/clusters/bridge-clusters-Actions.xml b/data_model/clusters/bridge-clusters-Actions.xml
index ccacb56e8b2576..51f7ee79bb4bad 100644
--- a/data_model/clusters/bridge-clusters-Actions.xml
+++ b/data_model/clusters/bridge-clusters-Actions.xml
@@ -157,28 +157,22 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/Aggregator.xml b/data_model/device_types/Aggregator.xml
index f9bff7aa27cd55..4e0eb1cee512c3 100644
--- a/data_model/device_types/Aggregator.xml
+++ b/data_model/device_types/Aggregator.xml
@@ -60,7 +60,7 @@ Davis, CA 95616, USA
-
+
diff --git a/data_model/device_types/ColorTemperatureLight.xml b/data_model/device_types/ColorTemperatureLight.xml
index 210ce03b2da41c..5d6ac140803e23 100644
--- a/data_model/device_types/ColorTemperatureLight.xml
+++ b/data_model/device_types/ColorTemperatureLight.xml
@@ -60,7 +60,7 @@ Davis, CA 95616, USA
-
+
@@ -114,12 +114,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/ContentApp.xml b/data_model/device_types/ContentApp.xml
index a6eb1a4ca0d424..0db03141e7f9a1 100644
--- a/data_model/device_types/ContentApp.xml
+++ b/data_model/device_types/ContentApp.xml
@@ -61,7 +61,6 @@ Davis, CA 95616, USA
-
diff --git a/data_model/device_types/DimmableLight.xml b/data_model/device_types/DimmableLight.xml
index ce5dce7c8bf192..42c7d20fb4caad 100644
--- a/data_model/device_types/DimmableLight.xml
+++ b/data_model/device_types/DimmableLight.xml
@@ -55,12 +55,11 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
-
@@ -114,12 +113,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/DimmablePlug-InUnit.xml b/data_model/device_types/DimmablePlug-InUnit.xml
index 0756ed62baf9c0..a41db3ad0ae255 100644
--- a/data_model/device_types/DimmablePlug-InUnit.xml
+++ b/data_model/device_types/DimmablePlug-InUnit.xml
@@ -60,7 +60,7 @@ Davis, CA 95616, USA
-
+
@@ -114,12 +114,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/DoorLockController.xml b/data_model/device_types/DoorLockController.xml
index a41cdad0e1bf5a..0e4529c8b5e381 100644
--- a/data_model/device_types/DoorLockController.xml
+++ b/data_model/device_types/DoorLockController.xml
@@ -63,16 +63,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
-
-
-
-
diff --git a/data_model/device_types/EVSE.xml b/data_model/device_types/EVSE.xml
index 42636733090c9c..f15b1db770b454 100644
--- a/data_model/device_types/EVSE.xml
+++ b/data_model/device_types/EVSE.xml
@@ -68,12 +68,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/ElectricalSensor.xml b/data_model/device_types/ElectricalSensor.xml
new file mode 100644
index 00000000000000..62c6dd9b4128b2
--- /dev/null
+++ b/data_model/device_types/ElectricalSensor.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data_model/device_types/ExtendedColorLight.xml b/data_model/device_types/ExtendedColorLight.xml
index a0337009f660eb..73490485fa27fa 100644
--- a/data_model/device_types/ExtendedColorLight.xml
+++ b/data_model/device_types/ExtendedColorLight.xml
@@ -60,7 +60,7 @@ Davis, CA 95616, USA
-
+
@@ -114,12 +114,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/NetworkInfraManager.xml b/data_model/device_types/NetworkInfraManager.xml
index 750a97f22cad86..cc7e22295f40be 100644
--- a/data_model/device_types/NetworkInfraManager.xml
+++ b/data_model/device_types/NetworkInfraManager.xml
@@ -65,5 +65,8 @@ Davis, CA 95616, USA
+
+
+
\ No newline at end of file
diff --git a/data_model/device_types/OnOffLight.xml b/data_model/device_types/OnOffLight.xml
index ea520612b9dc42..9762c718dcc05b 100644
--- a/data_model/device_types/OnOffLight.xml
+++ b/data_model/device_types/OnOffLight.xml
@@ -55,12 +55,11 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
-
@@ -114,12 +113,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/OnOffPlug-inUnit.xml b/data_model/device_types/OnOffPlug-inUnit.xml
index d63e3b22e81aae..41d0a1398ad6f3 100644
--- a/data_model/device_types/OnOffPlug-inUnit.xml
+++ b/data_model/device_types/OnOffPlug-inUnit.xml
@@ -55,12 +55,11 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
-
@@ -114,12 +113,6 @@ Davis, CA 95616, USA
-
-
-
-
-
-
diff --git a/data_model/device_types/PowerSource.xml b/data_model/device_types/PowerSource.xml
index 3767d5c19ad025..9ed71e905535bd 100644
--- a/data_model/device_types/PowerSource.xml
+++ b/data_model/device_types/PowerSource.xml
@@ -55,21 +55,14 @@ Connectivity Standards Alliance
508 Second Street, Suite 206
Davis, CA 95616, USA
-->
-
+
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data_model/device_types/TemperatureControlledCabinet.xml b/data_model/device_types/TemperatureControlledCabinet.xml
index 090931ace14f61..b39861690cad61 100644
--- a/data_model/device_types/TemperatureControlledCabinet.xml
+++ b/data_model/device_types/TemperatureControlledCabinet.xml
@@ -66,6 +66,14 @@ Davis, CA 95616, USA
+
+
+
+
+
+
+
+
diff --git a/data_model/device_types/Thermostat.xml b/data_model/device_types/Thermostat.xml
index 8676fe965ef280..fc154468e97c5f 100644
--- a/data_model/device_types/Thermostat.xml
+++ b/data_model/device_types/Thermostat.xml
@@ -97,9 +97,6 @@ Davis, CA 95616, USA
-
-
-
diff --git a/data_model/spec_sha b/data_model/spec_sha
index 9c275037d5b895..ec683a1872fc3e 100644
--- a/data_model/spec_sha
+++ b/data_model/spec_sha
@@ -1 +1 @@
-7e16e82e5264105bdc61d6bc8fe18095959b8292
+72ce960f71810d6ca96125aea54e4fb0a9631e34
diff --git a/docs/QUICK_START.md b/docs/QUICK_START.md
index 5a4027e3dc7278..97f0f76b3b0436 100644
--- a/docs/QUICK_START.md
+++ b/docs/QUICK_START.md
@@ -19,7 +19,7 @@ combination listed below.
| Border Router
| Node
| Description |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [**ot-br**](https://openthread.io/guides/border-router/build)
Thread Border Router RasPi BeagleBone | **lighting-app** [Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w/k32w0/README.md) [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/efr32/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
+| [**ot-br**](https://openthread.io/guides/border-router/build)
Thread Border Router RasPi BeagleBone | **lighting-app** [Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w/k32w0/README.md) [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/silabs/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
| [**ot-br**](https://openthread.io/guides/border-router/build)
Thread Border Router RasPi BeagleBone | **lock-app** [Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nrfconnect/README.md) [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nxp/k32w/k32w0/README.md) [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/qpg) [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/efr32/README.md) [TI CC13x2x7](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/cc13x2x7_26x2x7/README.md) | The Lock example is supported by many of the available Thread and Wi-Fi platforms. |
## Controllers
diff --git a/docs/guides/silabs_efr32_software_update.md b/docs/guides/silabs_efr32_software_update.md
index ec57cc4acaa372..9f94753aa7d29f 100644
--- a/docs/guides/silabs_efr32_software_update.md
+++ b/docs/guides/silabs_efr32_software_update.md
@@ -8,7 +8,7 @@ all of the EFR32 example applications.
## Running the OTA Download scenario
- For Matter with OpenThread: Bring up the OpenThread Border Router as
- discussed in examples/lighting-app/efr32/README.md and get its operational
+ discussed in examples/lighting-app/silabs/README.md and get its operational
dataset.
- On a Linux or Darwin platform build the chip-tool and the ota-provider-app
diff --git a/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h b/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h
index 23c82787b0203e..f950121b5a22b2 100644
--- a/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h
+++ b/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h
@@ -19,6 +19,7 @@
#pragma once
#include
+#include
namespace chip {
namespace app {
@@ -31,19 +32,20 @@ class RelativeHumiditySensorManager
void Init()
{
- EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MinMeasuredValue attribute"));
status = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 10000);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MaxMeasuredValue attribute"));
};
void OnHumidityChangeHandler(uint16_t newValue)
{
- EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status =
+ RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue);
}
diff --git a/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h b/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h
index 339d02588f52bc..f7061393d76cb6 100644
--- a/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h
+++ b/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h
@@ -19,6 +19,7 @@
#pragma once
#include
+#include
namespace chip {
namespace app {
@@ -31,19 +32,19 @@ class TemperatureSensorManager
void Init()
{
- EmberAfStatus status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -500);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -500);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MinMeasuredValue attribute"));
status = TemperatureMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 6000);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MaxMeasuredValue attribute"));
}
void OnTemperatureChangeHandler(int16_t newValue)
{
- EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue);
}
diff --git a/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp b/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp
index 3b3065e5e843de..22e938ddfa4023 100644
--- a/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp
+++ b/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp
@@ -196,12 +196,13 @@ void AirPurifierManager::PercentSettingWriteCallback(uint8_t aNewPercentSetting)
if (aNewPercentSetting != percentCurrent)
{
ChipLogDetail(NotSpecified, "AirPurifierManager::PercentSettingWriteCallback: %d", aNewPercentSetting);
- percentCurrent = aNewPercentSetting;
- EmberAfStatus status = FanControl::Attributes::PercentCurrent::Set(mEndpointId, percentCurrent);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ percentCurrent = aNewPercentSetting;
+ Status status = FanControl::Attributes::PercentCurrent::Set(mEndpointId, percentCurrent);
+ if (status != Status::Success)
{
ChipLogError(NotSpecified,
- "AirPurifierManager::PercentSettingWriteCallback: failed to set PercentCurrent attribute: %d", status);
+ "AirPurifierManager::PercentSettingWriteCallback: failed to set PercentCurrent attribute: %d",
+ to_underlying(status));
}
}
}
@@ -211,12 +212,12 @@ void AirPurifierManager::SpeedSettingWriteCallback(uint8_t aNewSpeedSetting)
if (aNewSpeedSetting != speedCurrent)
{
ChipLogDetail(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: %d", aNewSpeedSetting);
- speedCurrent = aNewSpeedSetting;
- EmberAfStatus status = FanControl::Attributes::SpeedCurrent::Set(mEndpointId, speedCurrent);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ speedCurrent = aNewSpeedSetting;
+ Status status = FanControl::Attributes::SpeedCurrent::Set(mEndpointId, speedCurrent);
+ if (status != Status::Success)
{
ChipLogError(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: failed to set SpeedCurrent attribute: %d",
- status);
+ to_underlying(status));
}
// Determine if the speed change should also change the fan mode
@@ -299,10 +300,11 @@ void AirPurifierManager::SetSpeedSetting(DataModel::Nullable aNewSpeedS
if (aNewSpeedSetting.Value() != speedCurrent)
{
- EmberAfStatus status = FanControl::Attributes::SpeedSetting::Set(mEndpointId, aNewSpeedSetting);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = FanControl::Attributes::SpeedSetting::Set(mEndpointId, aNewSpeedSetting);
+ if (status != Status::Success)
{
- ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: failed to set SpeedSetting attribute: %d", status);
+ ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: failed to set SpeedSetting attribute: %d",
+ to_underlying(status));
}
}
}
@@ -310,11 +312,12 @@ void AirPurifierManager::SetSpeedSetting(DataModel::Nullable aNewSpeedS
DataModel::Nullable AirPurifierManager::GetSpeedSetting()
{
DataModel::Nullable speedSetting;
- EmberAfStatus status = FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting);
+ Status status = FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogError(NotSpecified, "AirPurifierManager::GetSpeedSetting: failed to get SpeedSetting attribute: %d", status);
+ ChipLogError(NotSpecified, "AirPurifierManager::GetSpeedSetting: failed to get SpeedSetting attribute: %d",
+ to_underlying(status));
}
return speedSetting;
@@ -323,11 +326,12 @@ DataModel::Nullable AirPurifierManager::GetSpeedSetting()
DataModel::Nullable AirPurifierManager::GetPercentSetting()
{
DataModel::Nullable percentSetting;
- EmberAfStatus status = FanControl::Attributes::PercentSetting::Get(mEndpointId, percentSetting);
+ Status status = FanControl::Attributes::PercentSetting::Get(mEndpointId, percentSetting);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogError(NotSpecified, "AirPurifierManager::GetPercentSetting: failed to get PercentSetting attribute: %d", status);
+ ChipLogError(NotSpecified, "AirPurifierManager::GetPercentSetting: failed to get PercentSetting attribute: %d",
+ to_underlying(status));
}
return percentSetting;
diff --git a/examples/air-purifier-app/air-purifier-common/src/thermostat-manager.cpp b/examples/air-purifier-app/air-purifier-common/src/thermostat-manager.cpp
index c2536e4d99e38b..8d511d24e550dc 100644
--- a/examples/air-purifier-app/air-purifier-common/src/thermostat-manager.cpp
+++ b/examples/air-purifier-app/air-purifier-common/src/thermostat-manager.cpp
@@ -17,6 +17,9 @@
*/
#include "thermostat-manager.h"
+#include
+
+using chip::Protocols::InteractionModel::Status;
using namespace chip;
using namespace chip::app;
@@ -26,19 +29,19 @@ void ThermostatManager::Init()
{
BitMask FeatureMap;
FeatureMap.Set(Thermostat::Feature::kHeating);
- EmberAfStatus status = Thermostat::Attributes::FeatureMap::Set(mEndpointId, FeatureMap.Raw());
+ Status status = Thermostat::Attributes::FeatureMap::Set(mEndpointId, FeatureMap.Raw());
status = Thermostat::Attributes::ControlSequenceOfOperation::Set(mEndpointId,
Thermostat::ControlSequenceOfOperationEnum::kHeatingOnly);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat ControlSequenceOfOperation attribute"));
status = Thermostat::Attributes::AbsMinHeatSetpointLimit::Set(mEndpointId, 500);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat MinHeatSetpointLimit attribute"));
status = Thermostat::Attributes::AbsMaxHeatSetpointLimit::Set(mEndpointId, 3000);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set Thermostat MaxHeatSetpointLimit attribute"));
}
@@ -46,8 +49,8 @@ void ThermostatManager::HeatingSetpointWriteCallback(int16_t newValue)
{
ChipLogDetail(NotSpecified, "ThermostatManager::HeatingSetpointWriteCallback: %d", newValue);
Thermostat::SystemModeEnum systemMode;
- EmberAfStatus status = Thermostat::Attributes::SystemMode::Get(mEndpointId, &systemMode);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to get Thermostat SystemMode attribute"));
+ Status status = Thermostat::Attributes::SystemMode::Get(mEndpointId, &systemMode);
+ VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to get Thermostat SystemMode attribute"));
// A new setpoint has been set, so we shall infer that the we want to be in Heating mode
if (systemMode == Thermostat::SystemModeEnum::kOff)
@@ -58,7 +61,7 @@ void ThermostatManager::HeatingSetpointWriteCallback(int16_t newValue)
// Check the current temperature and turn on the heater if needed
DataModel::Nullable localTemperature;
status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to get TemperatureMeasurement MeasuredValue attribute"));
if (localTemperature.Value() < newValue)
@@ -81,14 +84,13 @@ void ThermostatManager::SystemModeWriteCallback(uint8_t newValue)
else if ((Thermostat::SystemModeEnum) newValue == Thermostat::SystemModeEnum::kHeat)
{
DataModel::Nullable localTemperature;
- EmberAfStatus status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Status status = Thermostat::Attributes::LocalTemperature::Get(mEndpointId, localTemperature);
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to get TemperatureMeasurement MeasuredValue attribute"));
int16_t heatingSetpoint;
status = Thermostat::Attributes::OccupiedHeatingSetpoint::Get(mEndpointId, &heatingSetpoint);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(NotSpecified, "Failed to get Thermostat HeatingSetpoint attribute"));
+ VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to get Thermostat HeatingSetpoint attribute"));
if (localTemperature.Value() < heatingSetpoint)
{
@@ -99,8 +101,8 @@ void ThermostatManager::SystemModeWriteCallback(uint8_t newValue)
void ThermostatManager::OnLocalTemperatureChangeCallback(int16_t temperature)
{
- EmberAfStatus status = Thermostat::Attributes::LocalTemperature::Set(mEndpointId, temperature);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Status status = Thermostat::Attributes::LocalTemperature::Set(mEndpointId, temperature);
+ VerifyOrReturn(Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute"));
}
@@ -122,14 +124,13 @@ void ThermostatManager::SetHeating(bool isHeating)
runningState.Clear(Thermostat::RelayStateBitmap::kHeat);
}
- EmberAfStatus status = Thermostat::Attributes::ThermostatRunningState::Set(mEndpointId, runningState);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(NotSpecified, "Failed to set Thermostat RunningState attribute"));
+ Status status = Thermostat::Attributes::ThermostatRunningState::Set(mEndpointId, runningState);
+ VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to set Thermostat RunningState attribute"));
}
void ThermostatManager::SetHeatMode(bool heat)
{
- EmberAfStatus status = Thermostat::Attributes::SystemMode::Set(
+ Status status = Thermostat::Attributes::SystemMode::Set(
mEndpointId, heat ? Thermostat::SystemModeEnum::kHeat : Thermostat::SystemModeEnum::kOff);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set Thermostat SystemMode attribute"));
+ VerifyOrReturn(Status::Success == status, ChipLogError(NotSpecified, "Failed to set Thermostat SystemMode attribute"));
}
diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h
index 4759f6096c84fc..0de2fa76e5ba61 100644
--- a/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h
+++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h
@@ -1,4 +1,5 @@
#include
+#include
#pragma once
@@ -11,19 +12,20 @@ class RelativeHumiditySensorManager
public:
RelativeHumiditySensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId)
{
- EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MinMeasuredValue attribute"));
status = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 100);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MaxMeasuredValue attribute"));
};
void OnHumidityChangeHandler(uint16_t newValue)
{
- EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status =
+ RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue);
}
diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h
index 3a0fc0cd0f4646..37f26e1412a886 100644
--- a/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h
+++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h
@@ -1,6 +1,8 @@
-#include
#pragma once
+#include
+
+#include
namespace chip {
namespace app {
@@ -11,19 +13,19 @@ class TemperatureSensorManager
public:
TemperatureSensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId)
{
- EmberAfStatus status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -5);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -5);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MinMeasuredValue attribute"));
status = TemperatureMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 60);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MaxMeasuredValue attribute"));
};
void OnTemperatureChangeHandler(int16_t newValue)
{
- EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
+ Protocols::InteractionModel::Status status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute"));
ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue);
}
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 f353ebeef68979..0f09892b936b6e 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
@@ -2732,7 +2732,7 @@ provisional cluster OvenMode = 73 {
/** This cluster supports remotely monitoring and controling the different typs of
functionality available to a drying device, such as a laundry dryer. */
-cluster LaundryDryerControls = 74 {
+provisional cluster LaundryDryerControls = 74 {
revision 1;
enum DrynessLevelEnum : enum8 {
@@ -7865,8 +7865,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;
@@ -7876,6 +7879,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 {
@@ -8110,7 +8119,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;
@@ -8335,11 +8344,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;
@@ -8347,13 +8354,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 2dab4707bb1453..03af457be918e2 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/binding-handler.cpp b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp
index cd16efd4a3f054..95f50acce7c4ef 100644
--- a/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp
@@ -73,13 +73,13 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
using namespace chip;
using namespace chip::app;
- if (binding.type == EMBER_MULTICAST_BINDING)
+ if (binding.type == MATTER_MULTICAST_BINDING)
{
ChipLogError(NotSpecified, "Group binding is not supported now");
return;
}
- if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 &&
+ if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
{
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
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/ameba/main/BindingHandler.cpp b/examples/all-clusters-app/ameba/main/BindingHandler.cpp
index 64ccb619a2edf5..b00322b44e4f0b 100644
--- a/examples/all-clusters-app/ameba/main/BindingHandler.cpp
+++ b/examples/all-clusters-app/ameba/main/BindingHandler.cpp
@@ -58,7 +58,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
if (data->isReadAttribute)
{
// It should always enter here if isReadAttribute is true
- if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -82,7 +82,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
}
else
{
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -103,7 +103,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -190,7 +190,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -205,7 +205,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
diff --git a/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h b/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h
index c1a37be41d385a..0d87a0eefcf828 100644
--- a/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h
+++ b/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h
@@ -19,6 +19,7 @@
#include "controller/InvokeInteraction.h"
#include "controller/ReadInteraction.h"
#include
+#include
#if CONFIG_ENABLE_CHIP_SHELL
#include "lib/shell/Engine.h"
@@ -65,7 +66,7 @@ CHIP_ERROR ManualDishWasherAlarmSetRaiseCommandHandler(int argc, char ** argv)
}
CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
DishwasherAlarmServer & serverInstance = DishwasherAlarmServer::Instance();
BitMask supported; // Set dishwasher alarm supported value
@@ -88,21 +89,21 @@ CHIP_ERROR ManualDishWasherAlarmSetRaiseCommandHandler(int argc, char ** argv)
state.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8
status = serverInstance.SetSupportedValue(1, supported); // 0x2F, 47
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetMaskValue(1, mask); // 0x2F, 47
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetStateValue(1, state); // 0x0E, 14
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
@@ -124,7 +125,7 @@ CHIP_ERROR ManualDishWasherAlarmSetLowerCommandHandler(int argc, char ** argv)
}
CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
DishwasherAlarmServer & serverInstance = DishwasherAlarmServer::Instance();
BitMask supported; // Set dishwasher alarm supported value
@@ -142,21 +143,21 @@ CHIP_ERROR ManualDishWasherAlarmSetLowerCommandHandler(int argc, char ** argv)
mask.SetField(AlarmMap::kWaterLevelError, 1); // 0x20, 32
status = serverInstance.SetSupportedValue(1, supported); // 0x2F, 47
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetMaskValue(1, mask); // 0x2F, 47
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetStateValue(1, 0); // Set dishwasher alarm state value 0x00, 0
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
diff --git a/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h b/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h
index d2ec4224a5332f..b4f8974d123a55 100644
--- a/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h
+++ b/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h
@@ -16,9 +16,12 @@
* limitations under the License.
*/
+#pragma once
+
#include "controller/InvokeInteraction.h"
#include "controller/ReadInteraction.h"
#include
+#include
#if CONFIG_ENABLE_CHIP_SHELL
#include "lib/shell/Engine.h"
@@ -60,25 +63,25 @@ CHIP_ERROR ManualRefrigeratorAlarmCommandHandler(int argc, char ** argv)
CHIP_ERROR ManualRefrigeratorAlarmDoorOpenCommandHandler(int argc, char ** argv)
{
CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance();
status = serverInstance.SetMaskValue(1, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetStateValue(1, 1);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetSupportedValue(1, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
@@ -96,25 +99,25 @@ CHIP_ERROR ManualRefrigeratorAlarmDoorOpenCommandHandler(int argc, char ** argv)
CHIP_ERROR ManualRefrigeratorAlarmDoorCloseCommandHandler(int argc, char ** argv)
{
CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance();
status = serverInstance.SetMaskValue(1, 1);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetStateValue(1, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetSupportedValue(1, 1);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
@@ -132,18 +135,18 @@ CHIP_ERROR ManualRefrigeratorAlarmDoorCloseCommandHandler(int argc, char ** argv
CHIP_ERROR ManualRefrigeratorAlarmSuppressCommandHandler(int argc, char ** argv)
{
CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance();
status = serverInstance.SetSupportedValue(1, 1);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
}
status = serverInstance.SetStateValue(1, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
err = CHIP_ERROR_INTERNAL;
goto exit;
diff --git a/examples/all-clusters-app/asr/src/AppTask.cpp b/examples/all-clusters-app/asr/src/AppTask.cpp
old mode 100755
new mode 100644
index 3f16789c40e69f..92b6aaef3dba49
--- a/examples/all-clusters-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-app/asr/src/AppTask.cpp
@@ -38,10 +38,13 @@
#include
#include
#include
+#include
#include
#include
#include
+using chip::Protocols::InteractionModel::Status;
+
using namespace ::chip;
using namespace ::chip::Credentials;
using namespace ::chip::DeviceManager;
@@ -265,11 +268,11 @@ void AppTask::OnOffUpdateClusterState(void)
uint8_t onoff = sLightLED.Get();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff);
+ Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
index 155bdacc2a8e4b..6cf5941e79d2c4 100644
--- a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
@@ -60,7 +60,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn
index 45d8d66d31c4b5..eb118372b7bd33 100644
--- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn
+++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn
@@ -63,7 +63,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
index e9f9dc1a171484..b75b5abfc74294 100644
--- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
@@ -409,11 +409,11 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
uint8_t onoff = sLightLED.Get();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
+ Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 2da7e0c8900f3d..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");
@@ -296,8 +304,9 @@ void AllClustersAppCommandHandler::OnSwitchLatchedHandler(uint8_t newPosition)
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The latching switch is moved to a new position:%d", newPosition);
Clusters::SwitchServer::Instance().OnSwitchLatch(endpoint, newPosition);
@@ -307,8 +316,9 @@ void AllClustersAppCommandHandler::OnSwitchInitialPressedHandler(uint8_t newPosi
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch starts to be pressed:%d", newPosition);
Clusters::SwitchServer::Instance().OnInitialPress(endpoint, newPosition);
@@ -318,8 +328,9 @@ void AllClustersAppCommandHandler::OnSwitchLongPressedHandler(uint8_t newPositio
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch has been pressed for a long time:%d", newPosition);
Clusters::SwitchServer::Instance().OnLongPress(endpoint, newPosition);
@@ -332,8 +343,9 @@ void AllClustersAppCommandHandler::OnSwitchShortReleasedHandler(uint8_t previous
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The the previous value of the CurrentPosition when the momentary switch has been released:%d",
previousPosition);
@@ -344,8 +356,9 @@ void AllClustersAppCommandHandler::OnSwitchLongReleasedHandler(uint8_t previousP
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified,
"The the previous value of the CurrentPosition when the momentary switch has been released after having been "
"pressed for a long time:%d",
@@ -358,8 +371,9 @@ void AllClustersAppCommandHandler::OnSwitchMultiPressOngoingHandler(uint8_t newP
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch has been pressed in a multi-press sequence:%d",
newPosition);
ChipLogDetail(NotSpecified, "%d times the momentary switch has been pressed", count);
@@ -371,8 +385,9 @@ void AllClustersAppCommandHandler::OnSwitchMultiPressCompleteHandler(uint8_t pre
{
EndpointId endpoint = 1;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The previous position when the momentary switch has been pressed in a multi-press sequence:%d",
previousPosition);
ChipLogDetail(NotSpecified, "%d times the momentary switch has been pressed", count);
@@ -429,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/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn
index bf42c172e2d735..cc61db4bf4379c 100644
--- a/examples/all-clusters-app/linux/BUILD.gn
+++ b/examples/all-clusters-app/linux/BUILD.gn
@@ -19,6 +19,14 @@ import("${build_root}/config/compiler/compiler.gni")
import("${chip_root}/src/lib/lib.gni")
import("${chip_root}/src/platform/device.gni")
+import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
+
+if (chip_enable_pw_rpc) {
+ import("//build_overrides/pigweed.gni")
+ import("$dir_pw_build/target_types.gni")
+ import("${chip_root}/examples/common/pigweed/rpc_config.gni")
+}
+
source_set("chip-all-clusters-common") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
@@ -78,7 +86,19 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/energy-management-app/energy-management-common/include",
]
- cflags = [ "-Wconversion" ]
+ if (chip_enable_pw_rpc) {
+ defines = rpc_defines
+ sources += rpc_sources
+ deps += rpc_deps
+
+ deps += pw_build_LINK_DEPS
+
+ include_dirs += [ "${chip_root}/examples/common" ]
+ } else {
+ # The system_rpc_server.cc file is in pigweed and doesn't compile with
+ # -Wconversion, remove check for RPC build only.
+ cflags = [ "-Wconversion" ]
+ }
if (chip_build_libshell) {
defines = [ "ENABLE_CHIP_SHELL" ]
diff --git a/examples/all-clusters-app/linux/with_pw_rpc.gni b/examples/all-clusters-app/linux/with_pw_rpc.gni
new file mode 100644
index 00000000000000..0f1ab1ea89c121
--- /dev/null
+++ b/examples/all-clusters-app/linux/with_pw_rpc.gni
@@ -0,0 +1,42 @@
+# Copyright (c) 2021 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.
+
+# add this gni as import in your build args to use pigweed in the example
+# 'import("//with_pw_rpc.gni")'
+
+import("//build_overrides/chip.gni")
+
+import("${chip_root}/config/standalone/args.gni")
+
+import("//build_overrides/pigweed.gni")
+
+pw_log_BACKEND = "$dir_pw_log_basic"
+pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
+pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
+pw_trace_BACKEND = "$dir_pw_trace_tokenized"
+pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main"
+pw_rpc_system_server_BACKEND = "${chip_root}/config/linux/lib/pw_rpc:pw_rpc"
+dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
+pw_chrono_SYSTEM_CLOCK_BACKEND = "$dir_pw_chrono_stl:system_clock"
+pw_sync_MUTEX_BACKEND = "$dir_pw_sync_stl:mutex_backend"
+pw_thread_YIELD_BACKEND = "$dir_pw_thread_stl:yield"
+pw_thread_SLEEP_BACKEND = "$dir_pw_thread_stl:sleep"
+
+pw_build_LINK_DEPS = [
+ "$dir_pw_assert:impl",
+ "$dir_pw_log:impl",
+]
+
+chip_enable_pw_rpc = true
+chip_use_pw_logging = true
diff --git a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
index 2d3a6e4e32f270..eaf2bda516f23e 100644
--- a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
+++ b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
@@ -55,9 +55,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
// Set FeatureMap to 0, default is:
// (kUser|kAccessSchedules|kRfidCredential|kPinCredential) 0x113
- EmberAfStatus status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/nxp/mw320/binding-handler.cpp b/examples/all-clusters-app/nxp/mw320/binding-handler.cpp
index 6ad25c9d46bc34..ace7da026b253a 100644
--- a/examples/all-clusters-app/nxp/mw320/binding-handler.cpp
+++ b/examples/all-clusters-app/nxp/mw320/binding-handler.cpp
@@ -74,13 +74,13 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
using namespace chip;
using namespace chip::app;
- if (binding.type == EMBER_MULTICAST_BINDING)
+ if (binding.type == MATTER_MULTICAST_BINDING)
{
ChipLogError(NotSpecified, "Group binding is not supported now");
return;
}
- if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 &&
+ if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
{
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
diff --git a/examples/all-clusters-app/nxp/mw320/main.cpp b/examples/all-clusters-app/nxp/mw320/main.cpp
index b778d95fc4430b..5f2df7b501e88d 100644
--- a/examples/all-clusters-app/nxp/mw320/main.cpp
+++ b/examples/all-clusters-app/nxp/mw320/main.cpp
@@ -286,7 +286,7 @@ void GPIO_IRQHandler(void)
#endif /* __cplusplus */
/*
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
uint8_t * buffer, uint16_t maxReadLength, int32_t index)
{
@@ -295,7 +295,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
if(clusterId == Clusters::Switch::Id) {
*buffer = g_ButtonPress;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
*/
@@ -1616,20 +1616,21 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
return;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
PRINTF("====> %s() \r\n", __FUNCTION__);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
// Added for the pairing of TE9 to report the commission_info
// default function (in callback-stub.cpp)
//
PRINTF("-> %s()\n\r", __FUNCTION__);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
diff --git a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
index 2d3a6e4e32f270..eaf2bda516f23e 100644
--- a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
+++ b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
@@ -55,9 +55,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
// Set FeatureMap to 0, default is:
// (kUser|kAccessSchedules|kRfidCredential|kPinCredential) 0x113
- EmberAfStatus status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 ac9dfe7ba5d8d0..d6f77d2f28a836 100644
--- a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
@@ -221,11 +221,11 @@ void AppTask::OnOffUpdateClusterState(void)
uint8_t onoff = sLightLED.Get();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
+ Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 3fcbc365fbc426..7cbaf6f447d405 100644
--- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
@@ -406,11 +406,11 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
uint8_t onoff = sLightLED.Get();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
+ Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(2, onoff);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/asr/subdevice/SubDeviceManager.cpp b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
index 72fbcc663d8582..ab0f2ef3b707a1 100644
--- a/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
+++ b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
@@ -103,8 +103,8 @@ CHIP_ERROR RemoveDeviceEndpoint(SubDevice * dev)
return CHIP_ERROR_INTERNAL;
}
-EmberAfStatus HandleReadBridgedDeviceBasicAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(SubDevice * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace BridgedDeviceBasicInformation::Attributes;
ChipLogProgress(DeviceLayer, "HandleReadBridgedDeviceBasicAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId,
@@ -125,13 +125,14 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(SubDevice * dev, chip::Attri
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleReadOnOffAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadOnOffAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer, "HandleReadOnOffAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId, maxReadLength);
@@ -145,24 +146,25 @@ EmberAfStatus HandleReadOnOffAttribute(SubDevice * dev, chip::AttributeId attrib
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleWriteOnOffAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer)
+Protocols::InteractionModel::Status HandleWriteOnOffAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer, "HandleWriteOnOffAttribute: attrId=%" PRIu32, attributeId);
- ReturnErrorCodeIf((attributeId != OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()), EMBER_ZCL_STATUS_FAILURE);
+ ReturnErrorCodeIf((attributeId != OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()),
+ Protocols::InteractionModel::Status::Failure);
dev->SetOnOff(*buffer == 1);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
@@ -181,11 +183,12 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
@@ -199,7 +202,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
namespace {
diff --git a/examples/bridge-app/asr/subdevice/SubDeviceManager.h b/examples/bridge-app/asr/subdevice/SubDeviceManager.h
index 3a91527f33e99c..29ce5067fe7faf 100644
--- a/examples/bridge-app/asr/subdevice/SubDeviceManager.h
+++ b/examples/bridge-app/asr/subdevice/SubDeviceManager.h
@@ -68,8 +68,8 @@ extern "C" {
int AddDeviceEndpoint(SubDevice * dev, EmberAfEndpointType * ep, const Span & deviceTypeList,
const Span & dataVersionStorage, chip::EndpointId parentEndpointId);
CHIP_ERROR RemoveDeviceEndpoint(SubDevice * dev);
-EmberAfStatus HandleReadBridgedDeviceBasicAttribute(SubDevice * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(SubDevice * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength);
void HandleDeviceStatusChanged(SubDevice * dev, SubDevice::Changed_t itemChangedMask);
void Init_Bridge_Endpoint();
#ifdef __cplusplus
diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp
index 92298a488c3186..27cdb3c5e2dab5 100644
--- a/examples/bridge-app/esp32/main/main.cpp
+++ b/examples/bridge-app/esp32/main/main.cpp
@@ -213,8 +213,8 @@ CHIP_ERROR RemoveDeviceEndpoint(Device * dev)
return CHIP_ERROR_INTERNAL;
}
-EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace BridgedDeviceBasicInformation::Attributes;
ChipLogProgress(DeviceLayer, "HandleReadBridgedDeviceBasicAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId,
@@ -236,13 +236,14 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleReadOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer, "HandleReadOnOffAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId, maxReadLength);
@@ -257,24 +258,25 @@ EmberAfStatus HandleReadOnOffAttribute(Device * dev, chip::AttributeId attribute
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleWriteOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer)
+Protocols::InteractionModel::Status HandleWriteOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer, "HandleWriteOnOffAttribute: attrId=%" PRIu32, attributeId);
- ReturnErrorCodeIf((attributeId != OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()), EMBER_ZCL_STATUS_FAILURE);
+ ReturnErrorCodeIf((attributeId != OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()),
+ Protocols::InteractionModel::Status::Failure);
dev->SetOnOff(*buffer == 1);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
@@ -292,11 +294,12 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
@@ -310,7 +313,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
namespace {
diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp
index 2c825fe8e5e010..80c8b17b7fbed5 100644
--- a/examples/bridge-app/linux/main.cpp
+++ b/examples/bridge-app/linux/main.cpp
@@ -436,8 +436,8 @@ void HandleDeviceTempSensorStatusChanged(DeviceTempSensor * dev, DeviceTempSenso
}
}
-EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace BridgedDeviceBasicInformation::Attributes;
@@ -464,13 +464,14 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleReadOnOffAttribute(DeviceOnOff * dev, chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadOnOffAttribute(DeviceOnOff * dev, chip::AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer, "HandleReadOnOffAttribute: attrId=%d, maxReadLength=%d", attributeId, maxReadLength);
@@ -485,13 +486,13 @@ EmberAfStatus HandleReadOnOffAttribute(DeviceOnOff * dev, chip::AttributeId attr
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleWriteOnOffAttribute(DeviceOnOff * dev, chip::AttributeId attributeId, uint8_t * buffer)
+Protocols::InteractionModel::Status HandleWriteOnOffAttribute(DeviceOnOff * dev, chip::AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer, "HandleWriteOnOffAttribute: attrId=%d", attributeId);
@@ -508,14 +509,14 @@ EmberAfStatus HandleWriteOnOffAttribute(DeviceOnOff * dev, chip::AttributeId att
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace TemperatureMeasurement::Attributes;
@@ -546,19 +547,19 @@ EmberAfStatus HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::A
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Failure;
if ((endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != nullptr))
{
@@ -643,12 +644,13 @@ class BridgedPowerSourceAttrAccess : public AttributeAccessInterface
BridgedPowerSourceAttrAccess gPowerAttrAccess;
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Failure;
// ChipLogProgress(DeviceLayer, "emberAfExternalAttributeWriteCallback: ep=%d", endpoint);
diff --git a/examples/bridge-app/telink/src/AppTask.cpp b/examples/bridge-app/telink/src/AppTask.cpp
index 3b4066bd87c2c7..d21897bd2d36b6 100644
--- a/examples/bridge-app/telink/src/AppTask.cpp
+++ b/examples/bridge-app/telink/src/AppTask.cpp
@@ -36,8 +36,8 @@ int AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, const Span & dataVersionStorage, chip::EndpointId parentEndpointId);
CHIP_ERROR RemoveDeviceEndpoint(Device * dev);
void HandleDeviceTempSensorStatusChanged(DeviceTempSensor * dev, DeviceTempSensor::Changed_t itemChangedMask);
-EmberAfStatus HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength);
static const int kNodeLabelSize = 32;
// Current ZCL implementation of Struct uses a max-size array of 254 bytes
@@ -236,8 +236,8 @@ CHIP_ERROR RemoveDeviceEndpoint(Device * dev)
return CHIP_ERROR_INTERNAL;
}
-EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace chip::app::Clusters::BridgedDeviceBasicInformation::Attributes;
ChipLogProgress(DeviceLayer, "HandleReadBridgedDeviceBasicAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId,
@@ -264,13 +264,14 @@ EmberAfStatus HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::Attribut
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleReadOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer, "HandleReadOnOffAttribute: attrId=%" PRIu32 ", maxReadLength=%u", attributeId, maxReadLength);
@@ -285,24 +286,25 @@ EmberAfStatus HandleReadOnOffAttribute(Device * dev, chip::AttributeId attribute
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus HandleWriteOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer)
+Protocols::InteractionModel::Status HandleWriteOnOffAttribute(Device * dev, chip::AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer, "HandleWriteOnOffAttribute: attrId=%" PRIu32, attributeId);
- ReturnErrorCodeIf((attributeId != Clusters::OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()), EMBER_ZCL_STATUS_FAILURE);
+ ReturnErrorCodeIf((attributeId != Clusters::OnOff::Attributes::OnOff::Id) || (!dev->IsReachable()),
+ Protocols::InteractionModel::Status::Failure);
dev->SetOnOff(*buffer == 1);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace Clusters;
@@ -327,11 +329,12 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
@@ -345,7 +348,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
}
}
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
namespace {
@@ -488,8 +491,8 @@ void HandleDeviceTempSensorStatusChanged(DeviceTempSensor * dev, DeviceTempSenso
}
}
-EmberAfStatus HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::AttributeId attributeId,
+ uint8_t * buffer, uint16_t maxReadLength)
{
using namespace Clusters::TemperatureMeasurement::Attributes;
@@ -520,10 +523,10 @@ EmberAfStatus HandleReadTempMeasurementAttribute(DeviceTempSensor * dev, chip::A
}
else
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Protocols::InteractionModel::Status::Failure;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
void AppTask::LightingActionEventHandler(AppEvent * aEvent)
@@ -590,16 +593,16 @@ void AppTask::UpdateClusterState(void)
bool isTurnedOn = sAppTask.mPwmRgbBlueLed.IsTurnedOn();
// write the new on/off value
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);
+ Protocols::InteractionModel::Status status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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/bridge-app/telink/src/ZclCallbacks.cpp b/examples/bridge-app/telink/src/ZclCallbacks.cpp
index b6f5ed558c584e..e83993165acb51 100644
--- a/examples/bridge-app/telink/src/ZclCallbacks.cpp
+++ b/examples/bridge-app/telink/src/ZclCallbacks.cpp
@@ -43,12 +43,12 @@ using namespace chip::app::Clusters::OnOff;
*/
void emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool storedValue;
// Read storedValue on/off value
status = Attributes::OnOff::Get(1, &storedValue);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Protocols::InteractionModel::Status::Success)
{
// Set actual state to stored before reboot
GetAppTask().GetPWMDevice().Set(storedValue);
diff --git a/examples/chef/chef.py b/examples/chef/chef.py
index 47d3c7ad3d34b7..688bdfef490761 100755
--- a/examples/chef/chef.py
+++ b/examples/chef/chef.py
@@ -730,7 +730,7 @@ def main() -> int:
shell.run_cmd(" ".join(nrf_build_cmds))
elif options.build_target == "silabs-thread":
- shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/efr32")
+ shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/silabs")
if options.do_clean:
shell.run_cmd(f"rm -rf out/{options.sample_device_type_name}")
efr32_cmd_args = []
diff --git a/examples/chef/common/chef-air-quality.cpp b/examples/chef/common/chef-air-quality.cpp
index 0770d0c185aa0c..eafff42d538fb6 100644
--- a/examples/chef/common/chef-air-quality.cpp
+++ b/examples/chef/common/chef-air-quality.cpp
@@ -40,15 +40,16 @@ void emberAfAirQualityClusterInitCallback(chip::EndpointId endpointId)
gAirQualityClusterInstance[endpointId] = clusterInstance;
}
-EmberAfStatus chefAirQualityWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status chefAirQualityWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
- EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success;
if (gAirQualityClusterInstance.find(endpoint) == gAirQualityClusterInstance.end())
{
ChipLogError(DeviceLayer, "Invalid Endpoind ID: %d", endpoint);
- return EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT;
+ return Protocols::InteractionModel::Status::UnsupportedEndpoint;
}
Instance * clusterInstance = gAirQualityClusterInstance[endpoint];
@@ -63,12 +64,12 @@ EmberAfStatus chefAirQualityWriteCallback(EndpointId endpoint, ClusterId cluster
{
break;
}
- ret = EMBER_ZCL_STATUS_UNSUPPORTED_WRITE;
+ ret = Protocols::InteractionModel::Status::UnsupportedWrite;
ChipLogError(DeviceLayer, "Invalid Attribute Update status: %d", static_cast(status));
}
break;
default:
- ret = EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
+ ret = Protocols::InteractionModel::Status::UnsupportedAttribute;
ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId));
break;
}
@@ -76,11 +77,11 @@ EmberAfStatus chefAirQualityWriteCallback(EndpointId endpoint, ClusterId cluster
return ret;
}
-EmberAfStatus chefAirQualityReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status chefAirQualityReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
+ uint16_t maxReadLength)
{
- EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success;
return ret;
}
diff --git a/examples/chef/common/chef-air-quality.h b/examples/chef/common/chef-air-quality.h
index 39019b03fbb781..2eaf3ef28fdf66 100644
--- a/examples/chef/common/chef-air-quality.h
+++ b/examples/chef/common/chef-air-quality.h
@@ -22,9 +22,10 @@
#include
#ifdef MATTER_DM_PLUGIN_AIR_QUALITY_SERVER
-EmberAfStatus chefAirQualityWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
-EmberAfStatus chefAirQualityReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status chefAirQualityWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer);
+Protocols::InteractionModel::Status chefAirQualityReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
+ uint16_t maxReadLength);
#endif
diff --git a/examples/chef/common/chef-concentration-measurement.cpp b/examples/chef/common/chef-concentration-measurement.cpp
index 395d6604582edf..2d8b65ba2cad19 100644
--- a/examples/chef/common/chef-concentration-measurement.cpp
+++ b/examples/chef/common/chef-concentration-measurement.cpp
@@ -55,19 +55,19 @@ static std::map *>
template
-EmberAfStatus chefConcentrationMeasurementWriteCallback(
+Protocols::InteractionModel::Status chefConcentrationMeasurementWriteCallback(
std::map *> & map,
AttributeId measuredValueId, chip::EndpointId endpoint, chip::ClusterId clusterId,
const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
{
- EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success;
if (map.find(endpoint) == map.end())
{
ChipLogError(DeviceLayer, "Invalid Endpoind ID: %d", endpoint);
- return EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT;
+ return Protocols::InteractionModel::Status::UnsupportedEndpoint;
}
Instance(attributeId));
}
return ret;
}
-EmberAfStatus chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
- EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success;
switch (clusterId)
{
@@ -174,11 +175,11 @@ EmberAfStatus chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoin
return ret;
}
-EmberAfStatus chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
- EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success;
return ret;
}
diff --git a/examples/chef/common/chef-concentration-measurement.h b/examples/chef/common/chef-concentration-measurement.h
index ddd004ebd7047e..9b8fc571872c6b 100644
--- a/examples/chef/common/chef-concentration-measurement.h
+++ b/examples/chef/common/chef-concentration-measurement.h
@@ -31,9 +31,10 @@
defined(MATTER_DM_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER) || \
defined(MATTER_DM_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER) || \
defined(MATTER_DM_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER)
-EmberAfStatus chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
-EmberAfStatus chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer);
+Protocols::InteractionModel::Status chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength);
#endif
diff --git a/examples/chef/common/chef-fan-control-manager.cpp b/examples/chef/common/chef-fan-control-manager.cpp
index 35d3579adf3439..998491d4a61aeb 100644
--- a/examples/chef/common/chef-fan-control-manager.cpp
+++ b/examples/chef/common/chef-fan-control-manager.cpp
@@ -56,9 +56,9 @@ CHIP_ERROR ChefFanControlManager::ReadPercentCurrent(AttributeValueEncoder & aEn
{
// Return PercentSetting attribute value for now
DataModel::Nullable percentSetting;
- EmberAfStatus status = PercentSetting::Get(mEndpoint, percentSetting);
+ Protocols::InteractionModel::Status status = PercentSetting::Get(mEndpoint, percentSetting);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, CHIP_ERROR_READ_FAILED);
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, CHIP_ERROR_READ_FAILED);
return aEncoder.Encode(percentSetting.ValueOr(0));
}
@@ -67,9 +67,9 @@ CHIP_ERROR ChefFanControlManager::ReadSpeedCurrent(AttributeValueEncoder & aEnco
{
// Return SpeedCurrent attribute value for now
DataModel::Nullable speedSetting;
- EmberAfStatus status = SpeedSetting::Get(mEndpoint, speedSetting);
+ Protocols::InteractionModel::Status status = SpeedSetting::Get(mEndpoint, speedSetting);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, CHIP_ERROR_READ_FAILED);
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, CHIP_ERROR_READ_FAILED);
return aEncoder.Encode(speedSetting.ValueOr(0));
}
@@ -81,19 +81,19 @@ Status ChefFanControlManager::HandleStep(StepDirectionEnum aDirection, bool aWra
VerifyOrReturnError(aDirection != StepDirectionEnum::kUnknownEnumValue, Status::InvalidCommand);
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
uint8_t speedMax;
status = SpeedMax::Get(mEndpoint, &speedMax);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::InvalidCommand);
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, Status::InvalidCommand);
uint8_t speedCurrent;
status = SpeedCurrent::Get(mEndpoint, &speedCurrent);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::InvalidCommand);
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, Status::InvalidCommand);
DataModel::Nullable speedSetting;
status = SpeedSetting::Get(mEndpoint, speedSetting);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::InvalidCommand);
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, Status::InvalidCommand);
uint8_t newSpeedSetting = speedSetting.ValueOr(0);
uint8_t speedValue = speedSetting.ValueOr(speedCurrent);
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/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp
index 483919c1c9a952..cff7ffdee4679f 100644
--- a/examples/chef/common/stubs.cpp
+++ b/examples/chef/common/stubs.cpp
@@ -23,9 +23,9 @@ using chip::app::DataModel::Nullable;
using namespace chip;
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
switch (clusterId)
{
@@ -58,7 +58,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
default:
break;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
/*
@@ -71,8 +71,9 @@ Thread 3 "rootnode_airqua" hit Breakpoint 1, emberAfExternalAttributeWriteCallba
48 '0', mask = 16 '\020'} (gdb)
*/
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer)
{
switch (clusterId)
{
@@ -105,7 +106,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
default:
break;
}
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Protocols::InteractionModel::Status::Success;
}
// Include door lock callbacks only when the server is enabled
diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py
index 355a2b18433e31..f4e8e6711d7105 100644
--- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py
+++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py
@@ -148,6 +148,17 @@
}
},
+ 'Bdx': {
+ 'commands': {
+ 'Download': {
+ 'arguments': {
+ 'LogType': 'log-type',
+ },
+ 'has_endpoint': False,
+ }
+ }
+ },
+
'DelayCommands': {
'alias': 'delay',
'commands': {
diff --git a/examples/common/imgui_ui/windows/light.cpp b/examples/common/imgui_ui/windows/light.cpp
index 24f88212ae23a1..86899e044b2ed1 100644
--- a/examples/common/imgui_ui/windows/light.cpp
+++ b/examples/common/imgui_ui/windows/light.cpp
@@ -70,13 +70,13 @@ void Light::UpdateState()
{
if (mTargetLightIsOn.HasValue())
{
- EmberAfStatus status = OnOffServer::Instance().setOnOffValue(
+ chip::Protocols::InteractionModel::Status status = OnOffServer::Instance().setOnOffValue(
mEndpointId, mTargetLightIsOn.Value() ? OnOff::Commands::On::Id : OnOff::Commands::Off::Id,
false /* initiatedByLevelChange */);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/common/pigweed/nxp/PigweedLoggerMutex.cpp b/examples/common/pigweed/nxp/PigweedLoggerMutex.cpp
new file mode 100644
index 00000000000000..ce5f5a9be0d21d
--- /dev/null
+++ b/examples/common/pigweed/nxp/PigweedLoggerMutex.cpp
@@ -0,0 +1,27 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#include "PigweedLoggerMutex.h"
+
+namespace chip {
+namespace rpc {
+
+PigweedLoggerMutex logger_mutex;
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/common/pigweed/nxp/PigweedLoggerMutex.h b/examples/common/pigweed/nxp/PigweedLoggerMutex.h
new file mode 100644
index 00000000000000..ecad8995bad61c
--- /dev/null
+++ b/examples/common/pigweed/nxp/PigweedLoggerMutex.h
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "PigweedLogger.h"
+#include "RpcService.h"
+
+namespace chip {
+namespace rpc {
+class PigweedLoggerMutex : public chip::rpc::Mutex
+{
+
+public:
+ void Lock() override { PigweedLogger::Lock(); }
+ void Unlock() override { PigweedLogger::Unlock(); }
+};
+
+extern PigweedLoggerMutex logger_mutex;
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/common/pigweed/rpc_config.gni b/examples/common/pigweed/rpc_config.gni
new file mode 100644
index 00000000000000..ddd6b0863ebf70
--- /dev/null
+++ b/examples/common/pigweed/rpc_config.gni
@@ -0,0 +1,53 @@
+# Copyright (c) 2021 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.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/pigweed.gni")
+
+rpc_defines = [
+ "PW_RPC_ENABLED",
+ "PW_RPC_ATTRIBUTE_SERVICE=1",
+ "PW_RPC_BUTTON_SERVICE=1",
+ "PW_RPC_DESCRIPTOR_SERVICE=1",
+ "PW_RPC_DEVICE_SERVICE=1",
+ "PW_RPC_LIGHTING_SERVICE=1",
+ "PW_RPC_TRACING_SERVICE=1",
+]
+
+rpc_sources = [
+ "${chip_root}/examples/platform/linux/Rpc.cpp",
+ "${chip_root}/examples/platform/linux/system_rpc_server.cc",
+]
+
+rpc_deps = [
+ "$dir_pw_hdlc:pw_rpc",
+ "$dir_pw_hdlc:rpc_channel_output",
+ "$dir_pw_log",
+ "$dir_pw_rpc:server",
+ "$dir_pw_rpc/system_server:facade",
+ "$dir_pw_rpc/system_server:socket",
+ "$dir_pw_stream:socket_stream",
+ "$dir_pw_stream:sys_io_stream",
+ "$dir_pw_sync:mutex",
+ "$dir_pw_trace",
+ "$dir_pw_trace_tokenized",
+ "$dir_pw_trace_tokenized:trace_rpc_service",
+ "${chip_root}/config/linux/lib/pw_rpc:pw_rpc",
+ "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:rpc_services",
+]
diff --git a/examples/common/pigweed/rpc_services/internal/StatusUtils.h b/examples/common/pigweed/rpc_services/internal/StatusUtils.h
index f92ee66afc44bb..3ea14d3f88923e 100644
--- a/examples/common/pigweed/rpc_services/internal/StatusUtils.h
+++ b/examples/common/pigweed/rpc_services/internal/StatusUtils.h
@@ -36,15 +36,15 @@
namespace chip {
namespace rpc {
-constexpr pw::Status ToPwStatus(EmberAfStatus ember_status)
+constexpr pw::Status ToPwStatus(Protocols::InteractionModel::Status ember_status)
{
switch (ember_status)
{
- case EMBER_ZCL_STATUS_SUCCESS:
+ case Protocols::InteractionModel::Status::Success:
return pw::OkStatus();
- case EMBER_ZCL_STATUS_NOT_FOUND:
+ case Protocols::InteractionModel::Status::NotFound:
return pw::Status::NotFound();
- case EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS:
+ case Protocols::InteractionModel::Status::UnsupportedAccess:
return pw::Status::PermissionDenied();
default:
return pw::Status::Unknown();
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 5c942db19b3af5..a46ea5db28df64 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -892,10 +892,10 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
uint8_t newValue = ContactSensorMgr().IsContactClosed();
// write the new on/off value
- EmberAfStatus status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/.gn b/examples/contact-sensor-app/nxp/k32w/k32w1/.gn
index dec954b4b9ff69..1e848295f6aa5b 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/.gn
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/.gn
@@ -26,4 +26,7 @@ default_args = {
target_os = "freertos"
import("//args.gni")
+
+ # Import default platform configs
+ import("${chip_root}/src/platform/nxp/k32w/k32w1/args.gni")
}
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
index 1404ad8dd36a1c..ed49c7bdd4f7a3 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
@@ -14,15 +14,19 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w1_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
-import("${k32w1_sdk_build_root}/k32w1_executable.gni")
-import("${k32w1_sdk_build_root}/k32w1_sdk.gni")
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/platform/device.gni")
+import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni")
declare_args() {
chip_software_version = 0
@@ -85,7 +89,7 @@ k32w1_executable("contact_sensor_app") {
deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
- "${chip_root}/examples/contact-sensor-app/contact-sensor-common",
+ "${chip_root}/examples/contact-sensor-app/nxp/zap",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
@@ -116,7 +120,6 @@ k32w1_executable("contact_sensor_app") {
ldflags = [
"-Wl,--defsym=__heap_size__=0",
"-Wl,--defsym=__stack_size__=0x480",
- "-Wl,--defsym=gNvmSectors=8",
"-Wl,--defsym=lp_ram_lower_limit=0x04000000",
"-Wl,--defsym=lp_ram_upper_limit=0x2001C000",
"-Wl,-print-memory-usage",
@@ -124,6 +127,10 @@ k32w1_executable("contact_sensor_app") {
"-T" + rebase_path(ldscript, root_build_dir),
]
+ if (chip_with_factory_data == 1) {
+ ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ]
+ }
+
output_dir = root_out_dir
}
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/README.md b/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
index da6e3eb00f2f66..28983f45c89578 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/README.md
@@ -19,6 +19,7 @@ into an existing Matter network and can be controlled by this network.
- [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous)
- [Device UI](#device-ui)
- [Building](#building)
+- [Manufacturing data](#manufacturing-data)
- [Flashing](#flashing)
- [Flashing the NBU image](#flashing-the-nbu-image)
- [Flashing the host image](#flashing-the-host-image)
@@ -108,7 +109,9 @@ initiate a reboot. The reset action can be cancelled by press SW2 button at any
point before the 6 second limit.
**Button SW3** can be used to change the state of the simulated contact sensor.
-The button behaves as a toggle, swapping the state every time it is pressed.
+The button behaves as a toggle, swapping the state every time it is short
+pressed. When long pressed, it does a clean soft reset that takes into account
+Matter shutdown procedure.
## Building
@@ -134,8 +137,17 @@ In case that Openthread CLI is needed, chip_with_ot_cli build argument must be
set to 1.
After a successful build, the `elf` and `srec` files are found in `out/debug/` -
+`see the files prefixed with chip-k32w1-contact-example`. After a successful
+build, the `elf` and `srec` files are found in `out/debug/` -
`see the files prefixed with chip-k32w1-contact-example`.
+## Manufacturing data
+
+Use `chip_with_factory_data=1` in the gn build command to enable factory data.
+
+For a full guide on manufacturing flow, please see
+[Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp_manufacturing_flow.md).
+
## Flashing
Two images must be written to the board: one for the host (CM33) and one for the
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni b/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
index c0497aa27421d2..18c41cb457bc86 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/args.gni
@@ -15,7 +15,6 @@
import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
-import("${chip_root}/examples/platform/nxp/k32w/k32w1/args.gni")
# SDK target. This is overridden to add our SDK app_config.h & defines.
k32w1_sdk_target = get_label_info(":sdk", "label_no_toolchain")
@@ -23,3 +22,7 @@ k32w1_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_ota_requestor = true
chip_stack_lock_tracking = "fatal"
chip_enable_ble = true
+
+chip_enable_icd_server = true
+chip_persist_subscriptions = true
+chip_subscription_timeout_resumption = true
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
index af3a7067c99e1a..8846799ed6edc9 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
@@ -28,6 +28,58 @@
#pragma once
+// Use hard-coded test certificates already embedded in generic chip code => set it to 0
+// Use real/development certificates => set it to 1 + file the provisioning section from
+// the internal flash
+#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0
+#endif
+
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+
+// VID/PID for product => will be used by Basic Information Cluster
+#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037
+#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA221
+
+// Set the following define to use the Certification Declaration from below and not use it stored in factory data section
+#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION
+#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION
+//-> format_version = 1
+//-> vendor_id = 0x1037
+//-> product_id_array = [ 0xA221 ]
+//-> device_type_id = 0x0015
+//-> certificate_id = "ZIG20142ZB330003-24"
+//-> security_level = 0
+//-> security_information = 0
+//-> version_number = 0x2694
+//-> certification_type = 1
+//-> dac_origin_vendor_id is not present
+//-> dac_origin_product_id is not present
+#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
+ { \
+ 0x30, 0x81, 0xe7, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xd9, 0x30, 0x81, 0xd6, \
+ 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \
+ 0x44, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x37, 0x04, 0x35, 0x15, 0x24, 0x00, \
+ 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x21, 0xa2, 0x18, 0x24, 0x03, 0x15, 0x2c, 0x04, 0x13, 0x5a, 0x49, \
+ 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, 0x05, \
+ 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, \
+ 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, \
+ 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, \
+ 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x1b, 0xf3, 0x13, 0x9b, \
+ 0x39, 0xb8, 0x3e, 0x87, 0xde, 0x2e, 0xdf, 0x51, 0xfb, 0xa3, 0xba, 0xcb, 0xc7, 0x4e, 0xef, 0x16, 0x6b, 0xa1, 0x04, \
+ 0xa0, 0x05, 0x7f, 0xc3, 0xd4, 0x15, 0x84, 0xd0, 0x44, 0x02, 0x20, 0x32, 0x98, 0xe2, 0x3c, 0x31, 0x16, 0x63, 0x60, \
+ 0x2e, 0x58, 0x93, 0x87, 0x50, 0x9e, 0x29, 0x10, 0x9d, 0xe5, 0x9b, 0xcd, 0xab, 0x64, 0x43, 0x08, 0xd6, 0xf6, 0x6f, \
+ 0x46, 0x7d, 0x22, 0x24, 0x42 \
+ }
+
+// All remaining data will be pulled from the provisioning region of flash.
+#endif
+
+#else
+
/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
@@ -56,18 +108,7 @@
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
- *
- * 0xFFF1: Test vendor.
- */
-#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1
-
-/**
- * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
- *
- */
-#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006
+#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
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 c7acba0f3ee1cb..10039bb8c9270e 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -94,6 +94,9 @@ using namespace chip;
using namespace chip::app;
AppTask AppTask::sAppTask;
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+static AppTask::FactoryDataProvider sFactoryDataProvider;
+#endif
static Identify gIdentify = { chip::EndpointId{ 1 }, AppTask::OnIdentifyStart, AppTask::OnIdentifyStop,
Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator };
@@ -150,8 +153,14 @@ CHIP_ERROR AppTask::Init()
// Init ZCL Data Model and start server
PlatformMgr().ScheduleWork(InitServer, 0);
- // Initialize device attestation config
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+ ReturnErrorOnFailure(sFactoryDataProvider.Init());
+ SetDeviceInstanceInfoProvider(&sFactoryDataProvider);
+ SetDeviceAttestationCredentialsProvider(&sFactoryDataProvider);
+ SetCommissionableDataProvider(&sFactoryDataProvider);
+#else
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
// QR code will be used with CHIP Tool
AppTask::PrintOnboardingInfo();
@@ -358,7 +367,7 @@ void AppTask::AppTaskMain(void * pvParameter)
void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)
{
- if ((pin_no != RESET_BUTTON) && (pin_no != CONTACT_SENSOR_BUTTON) && (pin_no != OTA_BUTTON) && (pin_no != BLE_BUTTON))
+ if ((pin_no != RESET_BUTTON) && (pin_no != CONTACT_SENSOR_BUTTON) && (pin_no != SOFT_RESET_BUTTON) && (pin_no != BLE_BUTTON))
{
return;
}
@@ -376,10 +385,10 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)
{
button_event.Handler = ContactActionEventHandler;
}
- else if (pin_no == OTA_BUTTON)
+ else if (pin_no == SOFT_RESET_BUTTON)
{
- // Starting OTA by button functionality is not used.
- // button_event.Handler = OTAHandler;
+ // Soft reset ensures that platform manager shutdown procedure is called.
+ button_event.Handler = SoftResetHandler;
}
else if (pin_no == BLE_BUTTON)
{
@@ -432,7 +441,7 @@ button_status_t AppTask::KBD_Callback(void * buttonHandle, button_callback_messa
case CONTACT_SENSOR_BUTTON:
K32W_LOG("pb2 long press");
- ButtonEventHandler(OTA_BUTTON, OTA_BUTTON_PUSH);
+ ButtonEventHandler(SOFT_RESET_BUTTON, SOFT_RESET_BUTTON_PUSH);
break;
}
break;
@@ -561,29 +570,14 @@ void AppTask::ContactActionEventHandler(void * aGenericEvent)
}
}
-void AppTask::OTAHandler(void * aGenericEvent)
+void AppTask::SoftResetHandler(void * aGenericEvent)
{
AppEvent * aEvent = (AppEvent *) aGenericEvent;
- if (aEvent->ButtonEvent.PinNo != OTA_BUTTON)
+ if (aEvent->ButtonEvent.PinNo != SOFT_RESET_BUTTON)
return;
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
- if (sAppTask.mFunction != Function::kNoneSelected)
- {
- K32W_LOG("Another function is scheduled. Could not initiate OTA!");
- return;
- }
-
- PlatformMgr().ScheduleWork(StartOTAQuery, 0);
-#endif
-}
-
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
-void AppTask::StartOTAQuery(intptr_t arg)
-{
- GetRequestorInstance()->TriggerImmediateQuery();
+ PlatformMgrImpl().CleanReset();
}
-#endif
void AppTask::BleHandler(void * aGenericEvent)
{
@@ -794,11 +788,11 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
uint8_t newValue = ContactSensorMgr().IsContactClosed();
// write the new on/off value
- EmberAfStatus status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
+ Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/include/AppTask.h b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
index 47b644769cfb63..bc19b0a9862ebd 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/AppTask.h
@@ -30,6 +30,10 @@
#include
#include
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+#include
+#endif
+
#include "FreeRTOS.h"
#include "fsl_component_button.h"
#include "timers.h"
@@ -45,6 +49,9 @@
class AppTask
{
public:
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+ using FactoryDataProvider = chip::DeviceLayer::FactoryDataProviderImpl;
+#endif
CHIP_ERROR StartAppTask();
static void AppTaskMain(void * pvParameter);
@@ -74,7 +81,7 @@ class AppTask
static void FunctionTimerEventHandler(void * aGenericEvent);
static button_status_t KBD_Callback(void * buttonHandle, button_callback_message_t * message, void * callbackParam);
static void HandleKeyboard(void);
- static void OTAHandler(void * aGenericEvent);
+ static void SoftResetHandler(void * aGenericEvent);
static void BleHandler(void * aGenericEvent);
static void BleStartAdvertising(intptr_t arg);
static void ContactActionEventHandler(void * aGenericEvent);
@@ -89,7 +96,6 @@ class AppTask
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
static void InitOTA(intptr_t arg);
- static void StartOTAQuery(intptr_t arg);
#endif
static void UpdateClusterStateInternal(intptr_t arg);
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/app_config.h b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/app_config.h
index b62ce79567e8db..fbcf14fe7d88d7 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/app_config.h
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/include/app_config.h
@@ -23,12 +23,12 @@
#define RESET_BUTTON 1
#define CONTACT_SENSOR_BUTTON 2
-#define OTA_BUTTON 3
+#define SOFT_RESET_BUTTON 3
#define BLE_BUTTON 4
#define RESET_BUTTON_PUSH 1
#define CONTACT_SENSOR_BUTTON_PUSH 2
-#define OTA_BUTTON_PUSH 3
+#define SOFT_RESET_BUTTON_PUSH 3
#define BLE_BUTTON_PUSH 4
#define APP_BUTTON_PUSH 1
diff --git a/examples/contact-sensor-app/nxp/zap/BUILD.gn b/examples/contact-sensor-app/nxp/zap/BUILD.gn
new file mode 100644
index 00000000000000..be4913cf3552ee
--- /dev/null
+++ b/examples/contact-sensor-app/nxp/zap/BUILD.gn
@@ -0,0 +1,25 @@
+# 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.
+
+import("//build_overrides/chip.gni")
+import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
+import("${chip_root}/src/app/chip_data_model.gni")
+
+chip_data_model("zap") {
+ zap_file = "contact-sensor-app.zap"
+
+ zap_pregenerated_dir =
+ "${chip_root}/zzz_generated/contact-sensor-app/nxp/zap-generated"
+ is_server = true
+}
diff --git a/examples/contact-sensor-app/nxp/zap/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap/contact-sensor-app.matter
new file mode 100644
index 00000000000000..03736833bb02d3
--- /dev/null
+++ b/examples/contact-sensor-app/nxp/zap/contact-sensor-app.matter
@@ -0,0 +1,1646 @@
+// This IDL was generated automatically by ZAP.
+// It is for view/code review purposes only.
+
+/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
+cluster Identify = 3 {
+ revision 4;
+
+ enum EffectIdentifierEnum : enum8 {
+ kBlink = 0;
+ kBreathe = 1;
+ kOkay = 2;
+ kChannelChange = 11;
+ kFinishEffect = 254;
+ kStopEffect = 255;
+ }
+
+ enum EffectVariantEnum : enum8 {
+ kDefault = 0;
+ }
+
+ enum IdentifyTypeEnum : enum8 {
+ kNone = 0;
+ kLightOutput = 1;
+ kVisibleIndicator = 2;
+ kAudibleBeep = 3;
+ kDisplay = 4;
+ kActuator = 5;
+ }
+
+ attribute int16u identifyTime = 0;
+ readonly attribute IdentifyTypeEnum identifyType = 1;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct IdentifyRequest {
+ int16u identifyTime = 0;
+ }
+
+ request struct TriggerEffectRequest {
+ EffectIdentifierEnum effectIdentifier = 0;
+ EffectVariantEnum effectVariant = 1;
+ }
+
+ /** Command description for Identify */
+ command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0;
+ /** Command description for TriggerEffect */
+ command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
+}
+
+/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
+cluster Descriptor = 29 {
+ revision 2;
+
+ bitmap Feature : bitmap32 {
+ kTagList = 0x1;
+ }
+
+ struct DeviceTypeStruct {
+ devtype_id deviceType = 0;
+ int16u revision = 1;
+ }
+
+ struct SemanticTagStruct {
+ nullable vendor_id mfgCode = 0;
+ enum8 namespaceID = 1;
+ enum8 tag = 2;
+ optional nullable char_string label = 3;
+ }
+
+ readonly attribute DeviceTypeStruct deviceTypeList[] = 0;
+ readonly attribute cluster_id serverList[] = 1;
+ readonly attribute cluster_id clientList[] = 2;
+ readonly attribute endpoint_no partsList[] = 3;
+ readonly attribute optional SemanticTagStruct tagList[] = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** The Access Control Cluster exposes a data model view of a
+ Node's Access Control List (ACL), which codifies the rules used to manage
+ and enforce Access Control for the Node's endpoints and their associated
+ cluster instances. */
+cluster AccessControl = 31 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum AccessControlEntryAuthModeEnum : enum8 {
+ kPASE = 1;
+ kCASE = 2;
+ kGroup = 3;
+ }
+
+ enum AccessControlEntryPrivilegeEnum : enum8 {
+ kView = 1;
+ kProxyView = 2;
+ kOperate = 3;
+ kManage = 4;
+ kAdminister = 5;
+ }
+
+ enum ChangeTypeEnum : enum8 {
+ kChanged = 0;
+ kAdded = 1;
+ kRemoved = 2;
+ }
+
+ struct AccessControlTargetStruct {
+ nullable cluster_id cluster = 0;
+ nullable endpoint_no endpoint = 1;
+ nullable devtype_id deviceType = 2;
+ }
+
+ fabric_scoped struct AccessControlEntryStruct {
+ fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
+ fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
+ nullable fabric_sensitive int64u subjects[] = 3;
+ nullable fabric_sensitive AccessControlTargetStruct targets[] = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct AccessControlExtensionStruct {
+ fabric_sensitive octet_string<128> data = 1;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
+ nullable node_id adminNodeID = 1;
+ nullable int16u adminPasscodeID = 2;
+ ChangeTypeEnum changeType = 3;
+ nullable AccessControlEntryStruct latestValue = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
+ nullable node_id adminNodeID = 1;
+ nullable int16u adminPasscodeID = 2;
+ ChangeTypeEnum changeType = 3;
+ nullable AccessControlExtensionStruct latestValue = 4;
+ fabric_idx fabricIndex = 254;
+ }
+
+ attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
+ attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1;
+ readonly attribute int16u subjectsPerAccessControlEntry = 2;
+ readonly attribute int16u targetsPerAccessControlEntry = 3;
+ readonly attribute int16u accessControlEntriesPerFabric = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** This cluster provides attributes and events for determining basic information about Nodes, which supports both
+ Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number,
+ which apply to the whole Node. Also allows setting user device information such as location. */
+cluster BasicInformation = 40 {
+ revision 3;
+
+ enum ColorEnum : enum8 {
+ kBlack = 0;
+ kNavy = 1;
+ kGreen = 2;
+ kTeal = 3;
+ kMaroon = 4;
+ kPurple = 5;
+ kOlive = 6;
+ kGray = 7;
+ kBlue = 8;
+ kLime = 9;
+ kAqua = 10;
+ kRed = 11;
+ kFuchsia = 12;
+ kYellow = 13;
+ kWhite = 14;
+ kNickel = 15;
+ kChrome = 16;
+ kBrass = 17;
+ kCopper = 18;
+ kSilver = 19;
+ kGold = 20;
+ }
+
+ enum ProductFinishEnum : enum8 {
+ kOther = 0;
+ kMatte = 1;
+ kSatin = 2;
+ kPolished = 3;
+ kRugged = 4;
+ kFabric = 5;
+ }
+
+ struct CapabilityMinimaStruct {
+ int16u caseSessionsPerFabric = 0;
+ int16u subscriptionsPerFabric = 1;
+ }
+
+ struct ProductAppearanceStruct {
+ ProductFinishEnum finish = 0;
+ nullable ColorEnum primaryColor = 1;
+ }
+
+ critical event StartUp = 0 {
+ int32u softwareVersion = 0;
+ }
+
+ critical event ShutDown = 1 {
+ }
+
+ info event Leave = 2 {
+ fabric_idx fabricIndex = 0;
+ }
+
+ info event ReachableChanged = 3 {
+ boolean reachableNewValue = 0;
+ }
+
+ readonly attribute int16u dataModelRevision = 0;
+ readonly attribute char_string<32> vendorName = 1;
+ readonly attribute vendor_id vendorID = 2;
+ readonly attribute char_string<32> productName = 3;
+ readonly attribute int16u productID = 4;
+ attribute access(write: manage) char_string<32> nodeLabel = 5;
+ attribute access(write: administer) char_string<2> location = 6;
+ readonly attribute int16u hardwareVersion = 7;
+ readonly attribute char_string<64> hardwareVersionString = 8;
+ readonly attribute int32u softwareVersion = 9;
+ readonly attribute char_string<64> softwareVersionString = 10;
+ readonly attribute optional char_string<16> manufacturingDate = 11;
+ readonly attribute optional char_string<32> partNumber = 12;
+ readonly attribute optional long_char_string<256> productURL = 13;
+ readonly attribute optional char_string<64> productLabel = 14;
+ readonly attribute optional char_string<32> serialNumber = 15;
+ attribute access(write: manage) optional boolean localConfigDisabled = 16;
+ readonly attribute optional boolean reachable = 17;
+ readonly attribute optional char_string<32> uniqueID = 18;
+ readonly attribute CapabilityMinimaStruct capabilityMinima = 19;
+ readonly attribute optional ProductAppearanceStruct productAppearance = 20;
+ readonly attribute int32u specificationVersion = 21;
+ readonly attribute int16u maxPathsPerInvoke = 22;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ command MfgSpecificPing(): DefaultSuccess = 0;
+}
+
+/** Provides an interface for providing OTA software updates */
+cluster OtaSoftwareUpdateProvider = 41 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum ApplyUpdateActionEnum : enum8 {
+ kProceed = 0;
+ kAwaitNextAction = 1;
+ kDiscontinue = 2;
+ }
+
+ enum DownloadProtocolEnum : enum8 {
+ kBDXSynchronous = 0;
+ kBDXAsynchronous = 1;
+ kHTTPS = 2;
+ kVendorSpecific = 3;
+ }
+
+ enum StatusEnum : enum8 {
+ kUpdateAvailable = 0;
+ kBusy = 1;
+ kNotAvailable = 2;
+ kDownloadProtocolNotSupported = 3;
+ }
+
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct QueryImageRequest {
+ vendor_id vendorID = 0;
+ int16u productID = 1;
+ int32u softwareVersion = 2;
+ DownloadProtocolEnum protocolsSupported[] = 3;
+ optional int16u hardwareVersion = 4;
+ optional char_string<2> location = 5;
+ optional boolean requestorCanConsent = 6;
+ optional octet_string<512> metadataForProvider = 7;
+ }
+
+ response struct QueryImageResponse = 1 {
+ StatusEnum status = 0;
+ optional int32u delayedActionTime = 1;
+ optional char_string<256> imageURI = 2;
+ optional int32u softwareVersion = 3;
+ optional char_string<64> softwareVersionString = 4;
+ optional octet_string<32> updateToken = 5;
+ optional boolean userConsentNeeded = 6;
+ optional octet_string<512> metadataForRequestor = 7;
+ }
+
+ request struct ApplyUpdateRequestRequest {
+ octet_string<32> updateToken = 0;
+ int32u newVersion = 1;
+ }
+
+ response struct ApplyUpdateResponse = 3 {
+ ApplyUpdateActionEnum action = 0;
+ int32u delayedActionTime = 1;
+ }
+
+ request struct NotifyUpdateAppliedRequest {
+ octet_string<32> updateToken = 0;
+ int32u softwareVersion = 1;
+ }
+
+ /** Determine availability of a new Software Image */
+ command QueryImage(QueryImageRequest): QueryImageResponse = 0;
+ /** Determine next action to take for a downloaded Software Image */
+ command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2;
+ /** Notify OTA Provider that an update was applied */
+ command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4;
+}
+
+/** Provides an interface for downloading and applying OTA software updates */
+cluster OtaSoftwareUpdateRequestor = 42 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum AnnouncementReasonEnum : enum8 {
+ kSimpleAnnouncement = 0;
+ kUpdateAvailable = 1;
+ kUrgentUpdateAvailable = 2;
+ }
+
+ enum ChangeReasonEnum : enum8 {
+ kUnknown = 0;
+ kSuccess = 1;
+ kFailure = 2;
+ kTimeOut = 3;
+ kDelayByProvider = 4;
+ }
+
+ enum UpdateStateEnum : enum8 {
+ kUnknown = 0;
+ kIdle = 1;
+ kQuerying = 2;
+ kDelayedOnQuery = 3;
+ kDownloading = 4;
+ kApplying = 5;
+ kDelayedOnApply = 6;
+ kRollingBack = 7;
+ kDelayedOnUserConsent = 8;
+ }
+
+ fabric_scoped struct ProviderLocation {
+ node_id providerNodeID = 1;
+ endpoint_no endpoint = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ info event StateTransition = 0 {
+ UpdateStateEnum previousState = 0;
+ UpdateStateEnum newState = 1;
+ ChangeReasonEnum reason = 2;
+ nullable int32u targetSoftwareVersion = 3;
+ }
+
+ critical event VersionApplied = 1 {
+ int32u softwareVersion = 0;
+ int16u productID = 1;
+ }
+
+ info event DownloadError = 2 {
+ int32u softwareVersion = 0;
+ int64u bytesDownloaded = 1;
+ nullable int8u progressPercent = 2;
+ nullable int64s platformCode = 3;
+ }
+
+ attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0;
+ readonly attribute boolean updatePossible = 1;
+ readonly attribute UpdateStateEnum updateState = 2;
+ readonly attribute nullable int8u updateStateProgress = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct AnnounceOTAProviderRequest {
+ node_id providerNodeID = 0;
+ vendor_id vendorID = 1;
+ AnnouncementReasonEnum announcementReason = 2;
+ optional octet_string<512> metadataForNode = 3;
+ endpoint_no endpoint = 4;
+ }
+
+ /** Announce the presence of an OTA Provider */
+ command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0;
+}
+
+/** This cluster is used to manage global aspects of the Commissioning flow. */
+cluster GeneralCommissioning = 48 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CommissioningErrorEnum : enum8 {
+ kOK = 0;
+ kValueOutsideRange = 1;
+ kInvalidAuthentication = 2;
+ kNoFailSafe = 3;
+ kBusyWithOtherAdmin = 4;
+ }
+
+ enum RegulatoryLocationTypeEnum : enum8 {
+ kIndoor = 0;
+ kOutdoor = 1;
+ kIndoorOutdoor = 2;
+ }
+
+ struct BasicCommissioningInfo {
+ int16u failSafeExpiryLengthSeconds = 0;
+ int16u maxCumulativeFailsafeSeconds = 1;
+ }
+
+ attribute access(write: administer) int64u breadcrumb = 0;
+ readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1;
+ readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2;
+ readonly attribute RegulatoryLocationTypeEnum locationCapability = 3;
+ readonly attribute boolean supportsConcurrentConnection = 4;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ArmFailSafeRequest {
+ int16u expiryLengthSeconds = 0;
+ int64u breadcrumb = 1;
+ }
+
+ response struct ArmFailSafeResponse = 1 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string<128> debugText = 1;
+ }
+
+ request struct SetRegulatoryConfigRequest {
+ RegulatoryLocationTypeEnum newRegulatoryConfig = 0;
+ char_string<2> countryCode = 1;
+ int64u breadcrumb = 2;
+ }
+
+ response struct SetRegulatoryConfigResponse = 3 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string debugText = 1;
+ }
+
+ response struct CommissioningCompleteResponse = 5 {
+ CommissioningErrorEnum errorCode = 0;
+ char_string debugText = 1;
+ }
+
+ /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */
+ command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0;
+ /** Set the regulatory configuration to be used during commissioning */
+ command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2;
+ /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */
+ fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4;
+}
+
+/** Functionality to configure, enable, disable network credentials and access on a Matter device. */
+cluster NetworkCommissioning = 49 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum NetworkCommissioningStatusEnum : enum8 {
+ kSuccess = 0;
+ kOutOfRange = 1;
+ kBoundsExceeded = 2;
+ kNetworkIDNotFound = 3;
+ kDuplicateNetworkID = 4;
+ kNetworkNotFound = 5;
+ kRegulatoryError = 6;
+ kAuthFailure = 7;
+ kUnsupportedSecurity = 8;
+ kOtherConnectionFailure = 9;
+ kIPV6Failed = 10;
+ kIPBindFailed = 11;
+ kUnknownError = 12;
+ }
+
+ enum WiFiBandEnum : enum8 {
+ k2G4 = 0;
+ k3G65 = 1;
+ k5G = 2;
+ k6G = 3;
+ k60G = 4;
+ k1G = 5;
+ }
+
+ bitmap Feature : bitmap32 {
+ kWiFiNetworkInterface = 0x1;
+ kThreadNetworkInterface = 0x2;
+ kEthernetNetworkInterface = 0x4;
+ kPerDeviceCredentials = 0x8;
+ }
+
+ bitmap ThreadCapabilitiesBitmap : bitmap16 {
+ kIsBorderRouterCapable = 0x1;
+ kIsRouterCapable = 0x2;
+ kIsSleepyEndDeviceCapable = 0x4;
+ kIsFullThreadDevice = 0x8;
+ kIsSynchronizedSleepyEndDeviceCapable = 0x10;
+ }
+
+ bitmap WiFiSecurityBitmap : bitmap8 {
+ kUnencrypted = 0x1;
+ kWEP = 0x2;
+ kWPAPersonal = 0x4;
+ kWPA2Personal = 0x8;
+ kWPA3Personal = 0x10;
+ kWPA3MatterPDC = 0x20;
+ }
+
+ struct NetworkInfoStruct {
+ octet_string<32> networkID = 0;
+ boolean connected = 1;
+ optional nullable octet_string<20> networkIdentifier = 2;
+ optional nullable octet_string<20> clientIdentifier = 3;
+ }
+
+ struct ThreadInterfaceScanResultStruct {
+ int16u panId = 0;
+ int64u extendedPanId = 1;
+ char_string<16> networkName = 2;
+ int16u channel = 3;
+ int8u version = 4;
+ octet_string<8> extendedAddress = 5;
+ int8s rssi = 6;
+ int8u lqi = 7;
+ }
+
+ struct WiFiInterfaceScanResultStruct {
+ WiFiSecurityBitmap security = 0;
+ octet_string<32> ssid = 1;
+ octet_string<6> bssid = 2;
+ int16u channel = 3;
+ WiFiBandEnum wiFiBand = 4;
+ int8s rssi = 5;
+ }
+
+ readonly attribute access(read: administer) int8u maxNetworks = 0;
+ readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1;
+ readonly attribute optional int8u scanMaxTimeSeconds = 2;
+ readonly attribute optional int8u connectMaxTimeSeconds = 3;
+ attribute access(write: administer) boolean interfaceEnabled = 4;
+ readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5;
+ readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6;
+ readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7;
+ readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8;
+ readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9;
+ readonly attribute optional int16u threadVersion = 10;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct ScanNetworksRequest {
+ optional nullable octet_string<32> ssid = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct ScanNetworksResponse = 1 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string debugText = 1;
+ optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2;
+ optional ThreadInterfaceScanResultStruct threadScanResults[] = 3;
+ }
+
+ request struct AddOrUpdateWiFiNetworkRequest {
+ octet_string<32> ssid = 0;
+ octet_string<64> credentials = 1;
+ optional int64u breadcrumb = 2;
+ optional octet_string<140> networkIdentity = 3;
+ optional octet_string<20> clientIdentifier = 4;
+ optional octet_string<32> possessionNonce = 5;
+ }
+
+ request struct AddOrUpdateThreadNetworkRequest {
+ octet_string<254> operationalDataset = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ request struct RemoveNetworkRequest {
+ octet_string<32> networkID = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct NetworkConfigResponse = 5 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string<512> debugText = 1;
+ optional int8u networkIndex = 2;
+ optional octet_string<140> clientIdentity = 3;
+ optional octet_string<64> possessionSignature = 4;
+ }
+
+ request struct ConnectNetworkRequest {
+ octet_string<32> networkID = 0;
+ optional int64u breadcrumb = 1;
+ }
+
+ response struct ConnectNetworkResponse = 7 {
+ NetworkCommissioningStatusEnum networkingStatus = 0;
+ optional char_string debugText = 1;
+ nullable int32s errorValue = 2;
+ }
+
+ request struct ReorderNetworkRequest {
+ octet_string<32> networkID = 0;
+ int8u networkIndex = 1;
+ optional int64u breadcrumb = 2;
+ }
+
+ request struct QueryIdentityRequest {
+ octet_string<20> keyIdentifier = 0;
+ optional octet_string<32> possessionNonce = 1;
+ }
+
+ response struct QueryIdentityResponse = 10 {
+ octet_string<140> identity = 0;
+ optional octet_string<64> possessionSignature = 1;
+ }
+
+ /** Detemine the set of networks the device sees as available. */
+ command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0;
+ /** Add or update the credentials for a given Wi-Fi network. */
+ command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2;
+ /** Add or update the credentials for a given Thread network. */
+ command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3;
+ /** Remove the definition of a given network (including its credentials). */
+ command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4;
+ /** Connect to the specified network, using previously-defined credentials. */
+ command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6;
+ /** Modify the order in which networks will be presented in the Networks attribute. */
+ command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8;
+ /** Retrieve details about and optionally proof of possession of a network client identity. */
+ command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9;
+}
+
+/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
+cluster GeneralDiagnostics = 51 {
+ revision 2;
+
+ enum BootReasonEnum : enum8 {
+ kUnspecified = 0;
+ kPowerOnReboot = 1;
+ kBrownOutReset = 2;
+ kSoftwareWatchdogReset = 3;
+ kHardwareWatchdogReset = 4;
+ kSoftwareUpdateCompleted = 5;
+ kSoftwareReset = 6;
+ }
+
+ enum HardwareFaultEnum : enum8 {
+ kUnspecified = 0;
+ kRadio = 1;
+ kSensor = 2;
+ kResettableOverTemp = 3;
+ kNonResettableOverTemp = 4;
+ kPowerSource = 5;
+ kVisualDisplayFault = 6;
+ kAudioOutputFault = 7;
+ kUserInterfaceFault = 8;
+ kNonVolatileMemoryError = 9;
+ kTamperDetected = 10;
+ }
+
+ enum InterfaceTypeEnum : enum8 {
+ kUnspecified = 0;
+ kWiFi = 1;
+ kEthernet = 2;
+ kCellular = 3;
+ kThread = 4;
+ }
+
+ enum NetworkFaultEnum : enum8 {
+ kUnspecified = 0;
+ kHardwareFailure = 1;
+ kNetworkJammed = 2;
+ kConnectionFailed = 3;
+ }
+
+ enum RadioFaultEnum : enum8 {
+ kUnspecified = 0;
+ kWiFiFault = 1;
+ kCellularFault = 2;
+ kThreadFault = 3;
+ kNFCFault = 4;
+ kBLEFault = 5;
+ kEthernetFault = 6;
+ }
+
+ bitmap Feature : bitmap32 {
+ kDataModelTest = 0x1;
+ }
+
+ struct NetworkInterface {
+ char_string<32> name = 0;
+ boolean isOperational = 1;
+ nullable boolean offPremiseServicesReachableIPv4 = 2;
+ nullable boolean offPremiseServicesReachableIPv6 = 3;
+ octet_string<8> hardwareAddress = 4;
+ octet_string IPv4Addresses[] = 5;
+ octet_string IPv6Addresses[] = 6;
+ InterfaceTypeEnum type = 7;
+ }
+
+ critical event HardwareFaultChange = 0 {
+ HardwareFaultEnum current[] = 0;
+ HardwareFaultEnum previous[] = 1;
+ }
+
+ critical event RadioFaultChange = 1 {
+ RadioFaultEnum current[] = 0;
+ RadioFaultEnum previous[] = 1;
+ }
+
+ critical event NetworkFaultChange = 2 {
+ NetworkFaultEnum current[] = 0;
+ NetworkFaultEnum previous[] = 1;
+ }
+
+ critical event BootReason = 3 {
+ BootReasonEnum bootReason = 0;
+ }
+
+ readonly attribute NetworkInterface networkInterfaces[] = 0;
+ readonly attribute int16u rebootCount = 1;
+ readonly attribute optional int64u upTime = 2;
+ readonly attribute optional int32u totalOperationalHours = 3;
+ readonly attribute optional BootReasonEnum bootReason = 4;
+ readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5;
+ readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6;
+ readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7;
+ readonly attribute boolean testEventTriggersEnabled = 8;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct TestEventTriggerRequest {
+ octet_string<16> enableKey = 0;
+ int64u eventTrigger = 1;
+ }
+
+ response struct TimeSnapshotResponse = 2 {
+ systime_ms systemTimeMs = 0;
+ nullable posix_ms posixTimeMs = 1;
+ }
+
+ request struct PayloadTestRequestRequest {
+ octet_string<16> enableKey = 0;
+ int8u value = 1;
+ int16u count = 2;
+ }
+
+ response struct PayloadTestResponse = 4 {
+ octet_string payload = 0;
+ }
+
+ /** Provide a means for certification tests to trigger some test-plan-specific events */
+ command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
+ /** Take a snapshot of system time and epoch time. */
+ command TimeSnapshot(): TimeSnapshotResponse = 1;
+ /** Request a variable length payload response. */
+ command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
+}
+
+/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
+cluster SoftwareDiagnostics = 52 {
+ revision 1; // NOTE: Default/not specifically set
+
+ bitmap Feature : bitmap32 {
+ kWatermarks = 0x1;
+ }
+
+ struct ThreadMetricsStruct {
+ int64u id = 0;
+ optional char_string<8> name = 1;
+ optional int32u stackFreeCurrent = 2;
+ optional int32u stackFreeMinimum = 3;
+ optional int32u stackSize = 4;
+ }
+
+ info event SoftwareFault = 0 {
+ int64u id = 0;
+ optional char_string name = 1;
+ optional octet_string faultRecording = 2;
+ }
+
+ readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0;
+ readonly attribute optional int64u currentHeapFree = 1;
+ readonly attribute optional int64u currentHeapUsed = 2;
+ readonly attribute optional int64u currentHeapHighWatermark = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */
+ command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0;
+}
+
+/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */
+cluster ThreadNetworkDiagnostics = 53 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum ConnectionStatusEnum : enum8 {
+ kConnected = 0;
+ kNotConnected = 1;
+ }
+
+ enum NetworkFaultEnum : enum8 {
+ kUnspecified = 0;
+ kLinkDown = 1;
+ kHardwareFailure = 2;
+ kNetworkJammed = 3;
+ }
+
+ enum RoutingRoleEnum : enum8 {
+ kUnspecified = 0;
+ kUnassigned = 1;
+ kSleepyEndDevice = 2;
+ kEndDevice = 3;
+ kREED = 4;
+ kRouter = 5;
+ kLeader = 6;
+ }
+
+ bitmap Feature : bitmap32 {
+ kPacketCounts = 0x1;
+ kErrorCounts = 0x2;
+ kMLECounts = 0x4;
+ kMACCounts = 0x8;
+ }
+
+ struct NeighborTableStruct {
+ int64u extAddress = 0;
+ int32u age = 1;
+ int16u rloc16 = 2;
+ int32u linkFrameCounter = 3;
+ int32u mleFrameCounter = 4;
+ int8u lqi = 5;
+ nullable int8s averageRssi = 6;
+ nullable int8s lastRssi = 7;
+ int8u frameErrorRate = 8;
+ int8u messageErrorRate = 9;
+ boolean rxOnWhenIdle = 10;
+ boolean fullThreadDevice = 11;
+ boolean fullNetworkData = 12;
+ boolean isChild = 13;
+ }
+
+ struct OperationalDatasetComponents {
+ boolean activeTimestampPresent = 0;
+ boolean pendingTimestampPresent = 1;
+ boolean masterKeyPresent = 2;
+ boolean networkNamePresent = 3;
+ boolean extendedPanIdPresent = 4;
+ boolean meshLocalPrefixPresent = 5;
+ boolean delayPresent = 6;
+ boolean panIdPresent = 7;
+ boolean channelPresent = 8;
+ boolean pskcPresent = 9;
+ boolean securityPolicyPresent = 10;
+ boolean channelMaskPresent = 11;
+ }
+
+ struct RouteTableStruct {
+ int64u extAddress = 0;
+ int16u rloc16 = 1;
+ int8u routerId = 2;
+ int8u nextHop = 3;
+ int8u pathCost = 4;
+ int8u LQIIn = 5;
+ int8u LQIOut = 6;
+ int8u age = 7;
+ boolean allocated = 8;
+ boolean linkEstablished = 9;
+ }
+
+ struct SecurityPolicy {
+ int16u rotationTime = 0;
+ int16u flags = 1;
+ }
+
+ info event ConnectionStatus = 0 {
+ ConnectionStatusEnum connectionStatus = 0;
+ }
+
+ info event NetworkFaultChange = 1 {
+ NetworkFaultEnum current[] = 0;
+ NetworkFaultEnum previous[] = 1;
+ }
+
+ readonly attribute nullable int16u channel = 0;
+ readonly attribute nullable RoutingRoleEnum routingRole = 1;
+ readonly attribute nullable char_string<16> networkName = 2;
+ readonly attribute nullable int16u panId = 3;
+ readonly attribute nullable int64u extendedPanId = 4;
+ readonly attribute nullable octet_string<17> meshLocalPrefix = 5;
+ readonly attribute optional int64u overrunCount = 6;
+ readonly attribute NeighborTableStruct neighborTable[] = 7;
+ readonly attribute RouteTableStruct routeTable[] = 8;
+ readonly attribute nullable int32u partitionId = 9;
+ readonly attribute nullable int16u weighting = 10;
+ readonly attribute nullable int16u dataVersion = 11;
+ readonly attribute nullable int16u stableDataVersion = 12;
+ readonly attribute nullable int8u leaderRouterId = 13;
+ readonly attribute optional int16u detachedRoleCount = 14;
+ readonly attribute optional int16u childRoleCount = 15;
+ readonly attribute optional int16u routerRoleCount = 16;
+ readonly attribute optional int16u leaderRoleCount = 17;
+ readonly attribute optional int16u attachAttemptCount = 18;
+ readonly attribute optional int16u partitionIdChangeCount = 19;
+ readonly attribute optional int16u betterPartitionAttachAttemptCount = 20;
+ readonly attribute optional int16u parentChangeCount = 21;
+ readonly attribute optional int32u txTotalCount = 22;
+ readonly attribute optional int32u txUnicastCount = 23;
+ readonly attribute optional int32u txBroadcastCount = 24;
+ readonly attribute optional int32u txAckRequestedCount = 25;
+ readonly attribute optional int32u txAckedCount = 26;
+ readonly attribute optional int32u txNoAckRequestedCount = 27;
+ readonly attribute optional int32u txDataCount = 28;
+ readonly attribute optional int32u txDataPollCount = 29;
+ readonly attribute optional int32u txBeaconCount = 30;
+ readonly attribute optional int32u txBeaconRequestCount = 31;
+ readonly attribute optional int32u txOtherCount = 32;
+ readonly attribute optional int32u txRetryCount = 33;
+ readonly attribute optional int32u txDirectMaxRetryExpiryCount = 34;
+ readonly attribute optional int32u txIndirectMaxRetryExpiryCount = 35;
+ readonly attribute optional int32u txErrCcaCount = 36;
+ readonly attribute optional int32u txErrAbortCount = 37;
+ readonly attribute optional int32u txErrBusyChannelCount = 38;
+ readonly attribute optional int32u rxTotalCount = 39;
+ readonly attribute optional int32u rxUnicastCount = 40;
+ readonly attribute optional int32u rxBroadcastCount = 41;
+ readonly attribute optional int32u rxDataCount = 42;
+ readonly attribute optional int32u rxDataPollCount = 43;
+ readonly attribute optional int32u rxBeaconCount = 44;
+ readonly attribute optional int32u rxBeaconRequestCount = 45;
+ readonly attribute optional int32u rxOtherCount = 46;
+ readonly attribute optional int32u rxAddressFilteredCount = 47;
+ readonly attribute optional int32u rxDestAddrFilteredCount = 48;
+ readonly attribute optional int32u rxDuplicatedCount = 49;
+ readonly attribute optional int32u rxErrNoFrameCount = 50;
+ readonly attribute optional int32u rxErrUnknownNeighborCount = 51;
+ readonly attribute optional int32u rxErrInvalidSrcAddrCount = 52;
+ readonly attribute optional int32u rxErrSecCount = 53;
+ readonly attribute optional int32u rxErrFcsCount = 54;
+ readonly attribute optional int32u rxErrOtherCount = 55;
+ readonly attribute optional nullable int64u activeTimestamp = 56;
+ readonly attribute optional nullable int64u pendingTimestamp = 57;
+ readonly attribute optional nullable int32u delay = 58;
+ readonly attribute nullable SecurityPolicy securityPolicy = 59;
+ readonly attribute nullable octet_string<4> channelPage0Mask = 60;
+ readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61;
+ readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ /** Reception of this command SHALL reset the OverrunCount attributes to 0 */
+ command access(invoke: manage) ResetCounts(): DefaultSuccess = 0;
+}
+
+/** Commands to trigger a Node to allow a new Administrator to commission it. */
+cluster AdministratorCommissioning = 60 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CommissioningWindowStatusEnum : enum8 {
+ kWindowNotOpen = 0;
+ kEnhancedWindowOpen = 1;
+ kBasicWindowOpen = 2;
+ }
+
+ enum StatusCode : enum8 {
+ kBusy = 2;
+ kPAKEParameterError = 3;
+ kWindowNotOpen = 4;
+ }
+
+ bitmap Feature : bitmap32 {
+ kBasic = 0x1;
+ }
+
+ readonly attribute CommissioningWindowStatusEnum windowStatus = 0;
+ readonly attribute nullable fabric_idx adminFabricIndex = 1;
+ readonly attribute nullable vendor_id adminVendorId = 2;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct OpenCommissioningWindowRequest {
+ int16u commissioningTimeout = 0;
+ octet_string PAKEPasscodeVerifier = 1;
+ int16u discriminator = 2;
+ int32u iterations = 3;
+ octet_string<32> salt = 4;
+ }
+
+ request struct OpenBasicCommissioningWindowRequest {
+ int16u commissioningTimeout = 0;
+ }
+
+ /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */
+ timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
+ /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */
+ timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
+ /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */
+ timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2;
+}
+
+/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */
+cluster OperationalCredentials = 62 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum CertificateChainTypeEnum : enum8 {
+ kDACCertificate = 1;
+ kPAICertificate = 2;
+ }
+
+ enum NodeOperationalCertStatusEnum : enum8 {
+ kOK = 0;
+ kInvalidPublicKey = 1;
+ kInvalidNodeOpId = 2;
+ kInvalidNOC = 3;
+ kMissingCsr = 4;
+ kTableFull = 5;
+ kInvalidAdminSubject = 6;
+ kFabricConflict = 9;
+ kLabelConflict = 10;
+ kInvalidFabricIndex = 11;
+ }
+
+ fabric_scoped struct FabricDescriptorStruct {
+ octet_string<65> rootPublicKey = 1;
+ vendor_id vendorID = 2;
+ fabric_id fabricID = 3;
+ node_id nodeID = 4;
+ char_string<32> label = 5;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct NOCStruct {
+ fabric_sensitive octet_string noc = 1;
+ nullable fabric_sensitive octet_string icac = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ readonly attribute access(read: administer) NOCStruct NOCs[] = 0;
+ readonly attribute FabricDescriptorStruct fabrics[] = 1;
+ readonly attribute int8u supportedFabrics = 2;
+ readonly attribute int8u commissionedFabrics = 3;
+ readonly attribute octet_string trustedRootCertificates[] = 4;
+ readonly attribute int8u currentFabricIndex = 5;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct AttestationRequestRequest {
+ octet_string<32> attestationNonce = 0;
+ }
+
+ response struct AttestationResponse = 1 {
+ octet_string<900> attestationElements = 0;
+ octet_string<64> attestationSignature = 1;
+ }
+
+ request struct CertificateChainRequestRequest {
+ CertificateChainTypeEnum certificateType = 0;
+ }
+
+ response struct CertificateChainResponse = 3 {
+ octet_string<600> certificate = 0;
+ }
+
+ request struct CSRRequestRequest {
+ octet_string<32> CSRNonce = 0;
+ optional boolean isForUpdateNOC = 1;
+ }
+
+ response struct CSRResponse = 5 {
+ octet_string NOCSRElements = 0;
+ octet_string attestationSignature = 1;
+ }
+
+ request struct AddNOCRequest {
+ octet_string<400> NOCValue = 0;
+ optional octet_string<400> ICACValue = 1;
+ octet_string<16> IPKValue = 2;
+ int64u caseAdminSubject = 3;
+ vendor_id adminVendorId = 4;
+ }
+
+ request struct UpdateNOCRequest {
+ octet_string NOCValue = 0;
+ optional octet_string ICACValue = 1;
+ }
+
+ response struct NOCResponse = 8 {
+ NodeOperationalCertStatusEnum statusCode = 0;
+ optional fabric_idx fabricIndex = 1;
+ optional char_string<128> debugText = 2;
+ }
+
+ request struct UpdateFabricLabelRequest {
+ char_string<32> label = 0;
+ }
+
+ request struct RemoveFabricRequest {
+ fabric_idx fabricIndex = 0;
+ }
+
+ request struct AddTrustedRootCertificateRequest {
+ octet_string rootCACertificate = 0;
+ }
+
+ /** Sender is requesting attestation information from the receiver. */
+ command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0;
+ /** Sender is requesting a device attestation certificate from the receiver. */
+ command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2;
+ /** Sender is requesting a certificate signing request (CSR) from the receiver. */
+ command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4;
+ /** Sender is requesting to add the new node operational certificates. */
+ command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6;
+ /** Sender is requesting to update the node operational certificates. */
+ fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7;
+ /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */
+ fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9;
+ /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */
+ command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
+ /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */
+ command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
+}
+
+/** The Group Key Management Cluster is the mechanism by which group keys are managed. */
+cluster GroupKeyManagement = 63 {
+ revision 1; // NOTE: Default/not specifically set
+
+ enum GroupKeySecurityPolicyEnum : enum8 {
+ kTrustFirst = 0;
+ kCacheAndSync = 1;
+ }
+
+ bitmap Feature : bitmap32 {
+ kCacheAndSync = 0x1;
+ }
+
+ fabric_scoped struct GroupInfoMapStruct {
+ group_id groupId = 1;
+ endpoint_no endpoints[] = 2;
+ optional char_string<16> groupName = 3;
+ fabric_idx fabricIndex = 254;
+ }
+
+ fabric_scoped struct GroupKeyMapStruct {
+ group_id groupId = 1;
+ int16u groupKeySetID = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ struct GroupKeySetStruct {
+ int16u groupKeySetID = 0;
+ GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1;
+ nullable octet_string<16> epochKey0 = 2;
+ nullable epoch_us epochStartTime0 = 3;
+ nullable octet_string<16> epochKey1 = 4;
+ nullable epoch_us epochStartTime1 = 5;
+ nullable octet_string<16> epochKey2 = 6;
+ nullable epoch_us epochStartTime2 = 7;
+ }
+
+ attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0;
+ readonly attribute GroupInfoMapStruct groupTable[] = 1;
+ readonly attribute int16u maxGroupsPerFabric = 2;
+ readonly attribute int16u maxGroupKeysPerFabric = 3;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct KeySetWriteRequest {
+ GroupKeySetStruct groupKeySet = 0;
+ }
+
+ request struct KeySetReadRequest {
+ int16u groupKeySetID = 0;
+ }
+
+ response struct KeySetReadResponse = 2 {
+ GroupKeySetStruct groupKeySet = 0;
+ }
+
+ request struct KeySetRemoveRequest {
+ int16u groupKeySetID = 0;
+ }
+
+ response struct KeySetReadAllIndicesResponse = 5 {
+ int16u groupKeySetIDs[] = 0;
+ }
+
+ /** Write a new set of keys for the given key set id. */
+ fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0;
+ /** Read the keys for a given key set id. */
+ fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1;
+ /** Revoke a Root Key from a Group */
+ fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3;
+ /** Return the list of Group Key Sets associated with the accessing fabric */
+ fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4;
+}
+
+/** This cluster provides an interface to a boolean state called StateValue. */
+cluster BooleanState = 69 {
+ revision 1;
+
+ info event StateChange = 0 {
+ boolean stateValue = 0;
+ }
+
+ readonly attribute boolean stateValue = 0;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+}
+
+/** Allows servers to ensure that listed clients are notified when a server is available for communication. */
+cluster IcdManagement = 70 {
+ revision 2;
+
+ enum OperatingModeEnum : enum8 {
+ kSIT = 0;
+ kLIT = 1;
+ }
+
+ bitmap Feature : bitmap32 {
+ kCheckInProtocolSupport = 0x1;
+ kUserActiveModeTrigger = 0x2;
+ kLongIdleTimeSupport = 0x4;
+ }
+
+ bitmap UserActiveModeTriggerBitmap : bitmap32 {
+ kPowerCycle = 0x1;
+ kSettingsMenu = 0x2;
+ kCustomInstruction = 0x4;
+ kDeviceManual = 0x8;
+ kActuateSensor = 0x10;
+ kActuateSensorSeconds = 0x20;
+ kActuateSensorTimes = 0x40;
+ kActuateSensorLightsBlink = 0x80;
+ kResetButton = 0x100;
+ kResetButtonLightsBlink = 0x200;
+ kResetButtonSeconds = 0x400;
+ kResetButtonTimes = 0x800;
+ kSetupButton = 0x1000;
+ kSetupButtonSeconds = 0x2000;
+ kSetupButtonLightsBlink = 0x4000;
+ kSetupButtonTimes = 0x8000;
+ kAppDefinedButton = 0x10000;
+ }
+
+ fabric_scoped struct MonitoringRegistrationStruct {
+ fabric_sensitive node_id checkInNodeID = 1;
+ fabric_sensitive int64u monitoredSubject = 2;
+ fabric_idx fabricIndex = 254;
+ }
+
+ readonly attribute int32u idleModeDuration = 0;
+ readonly attribute int32u activeModeDuration = 1;
+ readonly attribute int16u activeModeThreshold = 2;
+ readonly attribute access(read: administer) optional MonitoringRegistrationStruct registeredClients[] = 3;
+ readonly attribute access(read: administer) optional int32u ICDCounter = 4;
+ readonly attribute optional int16u clientsSupportedPerFabric = 5;
+ readonly attribute optional UserActiveModeTriggerBitmap userActiveModeTriggerHint = 6;
+ readonly attribute optional char_string<128> userActiveModeTriggerInstruction = 7;
+ readonly attribute optional OperatingModeEnum operatingMode = 8;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ request struct RegisterClientRequest {
+ node_id checkInNodeID = 0;
+ int64u monitoredSubject = 1;
+ octet_string<16> key = 2;
+ optional octet_string<16> verificationKey = 3;
+ }
+
+ response struct RegisterClientResponse = 1 {
+ int32u ICDCounter = 0;
+ }
+
+ request struct UnregisterClientRequest {
+ node_id checkInNodeID = 0;
+ optional octet_string<16> verificationKey = 1;
+ }
+
+ response struct StayActiveResponse = 4 {
+ int32u promisedActiveDuration = 0;
+ }
+
+ /** Register a client to the end device */
+ fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0;
+ /** Unregister a client from an end device */
+ fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2;
+ /** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */
+ command access(invoke: manage) StayActiveRequest(): StayActiveResponse = 3;
+}
+
+endpoint 0 {
+ device type ma_rootdevice = 22, version 2;
+
+ binding cluster OtaSoftwareUpdateProvider;
+
+ server cluster Descriptor {
+ callback attribute deviceTypeList;
+ callback attribute serverList;
+ callback attribute clientList;
+ callback attribute partsList;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+ }
+
+ server cluster AccessControl {
+ emits event AccessControlEntryChanged;
+ emits event AccessControlExtensionChanged;
+ callback attribute acl;
+ callback attribute subjectsPerAccessControlEntry;
+ callback attribute targetsPerAccessControlEntry;
+ callback attribute accessControlEntriesPerFabric;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ callback attribute clusterRevision;
+ }
+
+ server cluster BasicInformation {
+ emits event StartUp;
+ emits event ShutDown;
+ emits event Leave;
+ callback attribute dataModelRevision;
+ callback attribute vendorName;
+ callback attribute vendorID;
+ callback attribute productName;
+ callback attribute productID;
+ persist attribute nodeLabel;
+ callback attribute location;
+ callback attribute hardwareVersion;
+ callback attribute hardwareVersionString;
+ callback attribute softwareVersion;
+ callback attribute softwareVersionString;
+ callback attribute capabilityMinima;
+ callback attribute specificationVersion;
+ callback attribute maxPathsPerInvoke;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 2;
+ }
+
+ server cluster OtaSoftwareUpdateRequestor {
+ emits event StateTransition;
+ emits event VersionApplied;
+ emits event DownloadError;
+ callback attribute defaultOTAProviders;
+ ram attribute updatePossible default = 1;
+ ram attribute updateState default = 0;
+ ram attribute updateStateProgress default = 0;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command AnnounceOTAProvider;
+ }
+
+ server cluster GeneralCommissioning {
+ ram attribute breadcrumb default = 0x0000000000000000;
+ callback attribute basicCommissioningInfo;
+ callback attribute regulatoryConfig;
+ callback attribute locationCapability;
+ callback attribute supportsConcurrentConnection;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command ArmFailSafe;
+ handle command ArmFailSafeResponse;
+ handle command SetRegulatoryConfig;
+ handle command SetRegulatoryConfigResponse;
+ handle command CommissioningComplete;
+ handle command CommissioningCompleteResponse;
+ }
+
+ server cluster NetworkCommissioning {
+ ram attribute maxNetworks;
+ callback attribute networks;
+ ram attribute scanMaxTimeSeconds;
+ ram attribute connectMaxTimeSeconds;
+ ram attribute interfaceEnabled;
+ ram attribute lastNetworkingStatus;
+ ram attribute lastNetworkID;
+ ram attribute lastConnectErrorValue;
+ ram attribute featureMap default = 2;
+ ram attribute clusterRevision default = 1;
+
+ handle command ScanNetworks;
+ handle command ScanNetworksResponse;
+ handle command AddOrUpdateThreadNetwork;
+ handle command RemoveNetwork;
+ handle command NetworkConfigResponse;
+ handle command ConnectNetwork;
+ handle command ConnectNetworkResponse;
+ handle command ReorderNetwork;
+ }
+
+ server cluster GeneralDiagnostics {
+ emits event BootReason;
+ callback attribute networkInterfaces;
+ callback attribute rebootCount;
+ callback attribute activeNetworkFaults;
+ callback attribute testEventTriggersEnabled default = false;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+
+ handle command TestEventTrigger;
+ }
+
+ server cluster SoftwareDiagnostics {
+ callback attribute threadMetrics;
+ callback attribute currentHeapFree;
+ callback attribute currentHeapUsed;
+ callback attribute currentHeapHighWatermark;
+ callback attribute featureMap;
+ ram attribute clusterRevision default = 1;
+
+ handle command ResetWatermarks;
+ }
+
+ server cluster ThreadNetworkDiagnostics {
+ callback attribute channel;
+ callback attribute routingRole;
+ callback attribute networkName;
+ callback attribute panId;
+ callback attribute extendedPanId;
+ callback attribute meshLocalPrefix;
+ callback attribute overrunCount;
+ callback attribute neighborTable;
+ callback attribute routeTable;
+ callback attribute partitionId;
+ callback attribute weighting;
+ callback attribute dataVersion;
+ callback attribute stableDataVersion;
+ callback attribute leaderRouterId;
+ callback attribute detachedRoleCount;
+ callback attribute childRoleCount;
+ callback attribute routerRoleCount;
+ callback attribute leaderRoleCount;
+ callback attribute attachAttemptCount;
+ callback attribute partitionIdChangeCount;
+ callback attribute betterPartitionAttachAttemptCount;
+ callback attribute parentChangeCount;
+ callback attribute txTotalCount;
+ callback attribute txUnicastCount;
+ callback attribute txBroadcastCount;
+ callback attribute txAckRequestedCount;
+ callback attribute txAckedCount;
+ callback attribute txNoAckRequestedCount;
+ callback attribute txDataCount;
+ callback attribute txDataPollCount;
+ callback attribute txBeaconCount;
+ callback attribute txBeaconRequestCount;
+ callback attribute txOtherCount;
+ callback attribute txRetryCount;
+ callback attribute txDirectMaxRetryExpiryCount;
+ callback attribute txIndirectMaxRetryExpiryCount;
+ callback attribute txErrCcaCount;
+ callback attribute txErrAbortCount;
+ callback attribute txErrBusyChannelCount;
+ callback attribute rxTotalCount;
+ callback attribute rxUnicastCount;
+ callback attribute rxBroadcastCount;
+ callback attribute rxDataCount;
+ callback attribute rxDataPollCount;
+ callback attribute rxBeaconCount;
+ callback attribute rxBeaconRequestCount;
+ callback attribute rxOtherCount;
+ callback attribute rxAddressFilteredCount;
+ callback attribute rxDestAddrFilteredCount;
+ callback attribute rxDuplicatedCount;
+ callback attribute rxErrNoFrameCount;
+ callback attribute rxErrUnknownNeighborCount;
+ callback attribute rxErrInvalidSrcAddrCount;
+ callback attribute rxErrSecCount;
+ callback attribute rxErrFcsCount;
+ callback attribute rxErrOtherCount;
+ callback attribute securityPolicy;
+ callback attribute channelPage0Mask;
+ callback attribute operationalDatasetComponents;
+ callback attribute activeNetworkFaultsList;
+ ram attribute featureMap default = 0x000F;
+ ram attribute clusterRevision default = 1;
+
+ handle command ResetCounts;
+ }
+
+ server cluster AdministratorCommissioning {
+ callback attribute windowStatus;
+ callback attribute adminFabricIndex;
+ callback attribute adminVendorId;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command OpenCommissioningWindow;
+ handle command RevokeCommissioning;
+ }
+
+ server cluster OperationalCredentials {
+ callback attribute NOCs;
+ callback attribute fabrics;
+ callback attribute supportedFabrics;
+ callback attribute commissionedFabrics;
+ callback attribute trustedRootCertificates;
+ callback attribute currentFabricIndex;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+
+ handle command AttestationRequest;
+ handle command AttestationResponse;
+ handle command CertificateChainRequest;
+ handle command CertificateChainResponse;
+ handle command CSRRequest;
+ handle command CSRResponse;
+ handle command AddNOC;
+ handle command UpdateNOC;
+ handle command NOCResponse;
+ handle command UpdateFabricLabel;
+ handle command RemoveFabric;
+ handle command AddTrustedRootCertificate;
+ }
+
+ server cluster GroupKeyManagement {
+ callback attribute groupKeyMap;
+ callback attribute groupTable;
+ callback attribute maxGroupsPerFabric;
+ callback attribute maxGroupKeysPerFabric;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+
+ handle command KeySetWrite;
+ handle command KeySetRead;
+ handle command KeySetReadResponse;
+ handle command KeySetRemove;
+ handle command KeySetReadAllIndices;
+ handle command KeySetReadAllIndicesResponse;
+ }
+
+ server cluster IcdManagement {
+ callback attribute idleModeDuration;
+ callback attribute activeModeDuration;
+ callback attribute activeModeThreshold;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute eventList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0x0000;
+ ram attribute clusterRevision default = 1;
+ }
+}
+endpoint 1 {
+ device type ma_contactsensor = 21, version 1;
+
+
+ server cluster Identify {
+ ram attribute identifyTime default = 0x0000;
+ ram attribute identifyType default = 0x0;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 4;
+
+ handle command Identify;
+ handle command TriggerEffect;
+ }
+
+ server cluster Descriptor {
+ callback attribute deviceTypeList;
+ callback attribute serverList;
+ callback attribute clientList;
+ callback attribute partsList;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute attributeList;
+ callback attribute featureMap;
+ callback attribute clusterRevision;
+ }
+
+ server cluster BooleanState {
+ emits event StateChange;
+ ram attribute stateValue default = 0;
+ callback attribute generatedCommandList;
+ callback attribute acceptedCommandList;
+ callback attribute attributeList;
+ ram attribute featureMap default = 0;
+ ram attribute clusterRevision default = 1;
+ }
+}
+
+
diff --git a/examples/contact-sensor-app/nxp/zap/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap/contact-sensor-app.zap
new file mode 100644
index 00000000000000..bf037957bd2629
--- /dev/null
+++ b/examples/contact-sensor-app/nxp/zap/contact-sensor-app.zap
@@ -0,0 +1,3576 @@
+{
+ "fileFormat": 2,
+ "featureLevel": 99,
+ "creator": "zap",
+ "keyValuePairs": [
+ {
+ "key": "commandDiscovery",
+ "value": "1"
+ },
+ {
+ "key": "defaultResponsePolicy",
+ "value": "always"
+ },
+ {
+ "key": "manufacturerCodes",
+ "value": "0x1002"
+ }
+ ],
+ "package": [
+ {
+ "pathRelativity": "relativeToZap",
+ "path": "../../../../src/app/zap-templates/zcl/zcl.json",
+ "type": "zcl-properties",
+ "category": "matter",
+ "version": 1,
+ "description": "Matter SDK ZCL data"
+ },
+ {
+ "pathRelativity": "relativeToZap",
+ "path": "../../../../src/app/zap-templates/app-templates.json",
+ "type": "gen-templates-json",
+ "version": "chip-v1"
+ }
+ ],
+ "endpointTypes": [
+ {
+ "id": 1,
+ "name": "MA-rootdevice",
+ "deviceTypeRef": {
+ "code": 22,
+ "profileId": 259,
+ "label": "MA-rootdevice",
+ "name": "MA-rootdevice"
+ },
+ "deviceTypes": [
+ {
+ "code": 22,
+ "profileId": 259,
+ "label": "MA-rootdevice",
+ "name": "MA-rootdevice"
+ }
+ ],
+ "deviceVersions": [
+ 2
+ ],
+ "deviceIdentifiers": [
+ 22
+ ],
+ "deviceTypeName": "MA-rootdevice",
+ "deviceTypeCode": 22,
+ "deviceTypeProfileId": 259,
+ "clusters": [
+ {
+ "name": "Descriptor",
+ "code": 29,
+ "mfgCode": null,
+ "define": "DESCRIPTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DeviceTypeList",
+ "code": 0,
+ "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": "ServerList",
+ "code": 1,
+ "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": "ClientList",
+ "code": 2,
+ "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": "PartsList",
+ "code": 3,
+ "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": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Access Control",
+ "code": 31,
+ "mfgCode": null,
+ "define": "ACCESS_CONTROL_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "ACL",
+ "code": 0,
+ "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": "SubjectsPerAccessControlEntry",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "TargetsPerAccessControlEntry",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AccessControlEntriesPerFabric",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "AccessControlEntryChanged",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "AccessControlExtensionChanged",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "Basic Information",
+ "code": 40,
+ "mfgCode": null,
+ "define": "BASIC_INFORMATION_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DataModelRevision",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorName",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "VendorID",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "vendor_id",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductName",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ProductID",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "NodeLabel",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "NVM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Location",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersion",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "HardwareVersionString",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersion",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SoftwareVersionString",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CapabilityMinima",
+ "code": 19,
+ "mfgCode": null,
+ "side": "server",
+ "type": "CapabilityMinimaStruct",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SpecificationVersion",
+ "code": 21,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "MaxPathsPerInvoke",
+ "code": 22,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 1,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "StartUp",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "ShutDown",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "Leave",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "OTA Software Update Provider",
+ "code": 41,
+ "mfgCode": null,
+ "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER",
+ "side": "client",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "QueryImage",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "QueryImageResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ApplyUpdateRequest",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ApplyUpdateResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NotifyUpdateApplied",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "OTA Software Update Requestor",
+ "code": 42,
+ "mfgCode": null,
+ "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "AnnounceOTAProvider",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "DefaultOTAProviders",
+ "code": 0,
+ "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": "UpdatePossible",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpdateState",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "UpdateStateEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "UpdateStateProgress",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "StateTransition",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "VersionApplied",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "DownloadError",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "General Commissioning",
+ "code": 48,
+ "mfgCode": null,
+ "define": "GENERAL_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ArmFailSafe",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ArmFailSafeResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "SetRegulatoryConfig",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "SetRegulatoryConfigResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CommissioningComplete",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CommissioningCompleteResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "Breadcrumb",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0000000000000000",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "BasicCommissioningInfo",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "BasicCommissioningInfo",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RegulatoryConfig",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "RegulatoryLocationTypeEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LocationCapability",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "RegulatoryLocationTypeEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportsConcurrentConnection",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Network Commissioning",
+ "code": 49,
+ "mfgCode": null,
+ "define": "NETWORK_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ScanNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ScanNetworksResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddOrUpdateThreadNetwork",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveNetwork",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NetworkConfigResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ConnectNetwork",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "ConnectNetworkResponse",
+ "code": 7,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "ReorderNetwork",
+ "code": 8,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "MaxNetworks",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Networks",
+ "code": 1,
+ "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": "ScanMaxTimeSeconds",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ConnectMaxTimeSeconds",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "InterfaceEnabled",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastNetworkingStatus",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "NetworkCommissioningStatusEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastNetworkID",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "octet_string",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "LastConnectErrorValue",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32s",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "General Diagnostics",
+ "code": 51,
+ "mfgCode": null,
+ "define": "GENERAL_DIAGNOSTICS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "TestEventTrigger",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "NetworkInterfaces",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RebootCount",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ActiveNetworkFaults",
+ "code": 7,
+ "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": "TestEventTriggersEnabled",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "false",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "BootReason",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ },
+ {
+ "name": "Software Diagnostics",
+ "code": 52,
+ "mfgCode": null,
+ "define": "SOFTWARE_DIAGNOSTICS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ResetWatermarks",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "ThreadMetrics",
+ "code": 0,
+ "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": "CurrentHeapFree",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentHeapUsed",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentHeapHighWatermark",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Thread Network Diagnostics",
+ "code": 53,
+ "mfgCode": null,
+ "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "ResetCounts",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "Channel",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RoutingRole",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "RoutingRoleEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "NetworkName",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "char_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "PanId",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ExtendedPanId",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "MeshLocalPrefix",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "octet_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "OverrunCount",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "NeighborTable",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RouteTable",
+ "code": 8,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "PartitionId",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "Weighting",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "DataVersion",
+ "code": 11,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "StableDataVersion",
+ "code": 12,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "LeaderRouterId",
+ "code": 13,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "DetachedRoleCount",
+ "code": 14,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ChildRoleCount",
+ "code": 15,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RouterRoleCount",
+ "code": 16,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "LeaderRoleCount",
+ "code": 17,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttachAttemptCount",
+ "code": 18,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "PartitionIdChangeCount",
+ "code": 19,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "BetterPartitionAttachAttemptCount",
+ "code": 20,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ParentChangeCount",
+ "code": 21,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxTotalCount",
+ "code": 22,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxUnicastCount",
+ "code": 23,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxBroadcastCount",
+ "code": 24,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxAckRequestedCount",
+ "code": 25,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxAckedCount",
+ "code": 26,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxNoAckRequestedCount",
+ "code": 27,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxDataCount",
+ "code": 28,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxDataPollCount",
+ "code": 29,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxBeaconCount",
+ "code": 30,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxBeaconRequestCount",
+ "code": 31,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxOtherCount",
+ "code": 32,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxRetryCount",
+ "code": 33,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxDirectMaxRetryExpiryCount",
+ "code": 34,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxIndirectMaxRetryExpiryCount",
+ "code": 35,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxErrCcaCount",
+ "code": 36,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxErrAbortCount",
+ "code": 37,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TxErrBusyChannelCount",
+ "code": 38,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxTotalCount",
+ "code": 39,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxUnicastCount",
+ "code": 40,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxBroadcastCount",
+ "code": 41,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxDataCount",
+ "code": 42,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxDataPollCount",
+ "code": 43,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxBeaconCount",
+ "code": 44,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxBeaconRequestCount",
+ "code": 45,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxOtherCount",
+ "code": 46,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxAddressFilteredCount",
+ "code": 47,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxDestAddrFilteredCount",
+ "code": 48,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxDuplicatedCount",
+ "code": 49,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrNoFrameCount",
+ "code": 50,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrUnknownNeighborCount",
+ "code": 51,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrInvalidSrcAddrCount",
+ "code": 52,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrSecCount",
+ "code": 53,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrFcsCount",
+ "code": 54,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "RxErrOtherCount",
+ "code": 55,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SecurityPolicy",
+ "code": 59,
+ "mfgCode": null,
+ "side": "server",
+ "type": "SecurityPolicy",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ChannelPage0Mask",
+ "code": 60,
+ "mfgCode": null,
+ "side": "server",
+ "type": "octet_string",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "OperationalDatasetComponents",
+ "code": 61,
+ "mfgCode": null,
+ "side": "server",
+ "type": "OperationalDatasetComponents",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "ActiveNetworkFaultsList",
+ "code": 62,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x000F",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Administrator Commissioning",
+ "code": 60,
+ "mfgCode": null,
+ "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "OpenCommissioningWindow",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RevokeCommissioning",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "WindowStatus",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "CommissioningWindowStatusEnum",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AdminFabricIndex",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "fabric_idx",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AdminVendorId",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "vendor_id",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "AttestationRequest",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AttestationResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CertificateChainRequest",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CertificateChainResponse",
+ "code": 3,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "CSRRequest",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "CSRResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddNOC",
+ "code": 6,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "UpdateNOC",
+ "code": 7,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "NOCResponse",
+ "code": 8,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "AddTrustedRootCertificate",
+ "code": 11,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "NOCs",
+ "code": 0,
+ "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": "Fabrics",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "SupportedFabrics",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CommissionedFabrics",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "TrustedRootCertificates",
+ "code": 4,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "CurrentFabricIndex",
+ "code": 5,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int8u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Group Key Management",
+ "code": 63,
+ "mfgCode": null,
+ "define": "GROUP_KEY_MANAGEMENT_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "KeySetWrite",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetRead",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadResponse",
+ "code": 2,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetRemove",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadAllIndices",
+ "code": 4,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "KeySetReadAllIndicesResponse",
+ "code": 5,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "GroupKeyMap",
+ "code": 0,
+ "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": "GroupTable",
+ "code": 1,
+ "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": "MaxGroupsPerFabric",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "MaxGroupKeysPerFabric",
+ "code": 3,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "ICD Management",
+ "code": 70,
+ "mfgCode": null,
+ "define": "ICD_MANAGEMENT_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "IdleModeDuration",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ActiveModeDuration",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int32u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ActiveModeThreshold",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "EventList",
+ "code": 65530,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0000",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "MA-dimmablelight",
+ "deviceTypeRef": {
+ "code": 21,
+ "profileId": 259,
+ "label": "MA-contactsensor",
+ "name": "MA-contactsensor"
+ },
+ "deviceTypes": [
+ {
+ "code": 21,
+ "profileId": 259,
+ "label": "MA-contactsensor",
+ "name": "MA-contactsensor"
+ }
+ ],
+ "deviceVersions": [
+ 1
+ ],
+ "deviceIdentifiers": [
+ 21
+ ],
+ "deviceTypeName": "MA-contactsensor",
+ "deviceTypeCode": 21,
+ "deviceTypeProfileId": 259,
+ "clusters": [
+ {
+ "name": "Identify",
+ "code": 3,
+ "mfgCode": null,
+ "define": "IDENTIFY_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "Identify",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "TriggerEffect",
+ "code": 64,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "IdentifyTime",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0000",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "IdentifyType",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "type": "IdentifyTypeEnum",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "4",
+ "reportable": 1,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Descriptor",
+ "code": 29,
+ "mfgCode": null,
+ "define": "DESCRIPTOR_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "DeviceTypeList",
+ "code": 0,
+ "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": "ServerList",
+ "code": 1,
+ "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": "ClientList",
+ "code": 2,
+ "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": "PartsList",
+ "code": 3,
+ "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": "GeneratedCommandList",
+ "code": 65528,
+ "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": "AcceptedCommandList",
+ "code": 65529,
+ "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": "AttributeList",
+ "code": 65531,
+ "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": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Boolean State",
+ "code": 69,
+ "mfgCode": null,
+ "define": "BOOLEAN_STATE_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "attributes": [
+ {
+ "name": "StateValue",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "type": "boolean",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "GeneratedCommandList",
+ "code": 65528,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AcceptedCommandList",
+ "code": 65529,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "AttributeList",
+ "code": 65531,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "FeatureMap",
+ "code": 65532,
+ "mfgCode": null,
+ "side": "server",
+ "type": "bitmap32",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ClusterRevision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int16u",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "1",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ }
+ ],
+ "events": [
+ {
+ "name": "StateChange",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "endpoints": [
+ {
+ "endpointTypeName": "MA-rootdevice",
+ "endpointTypeIndex": 0,
+ "profileId": 259,
+ "endpointId": 0,
+ "networkId": 0
+ },
+ {
+ "endpointTypeName": "MA-dimmablelight",
+ "endpointTypeIndex": 1,
+ "profileId": 259,
+ "endpointId": 1,
+ "networkId": 0
+ }
+ ],
+ "log": []
+}
\ No newline at end of file
diff --git a/examples/contact-sensor-app/telink/src/AppTask.cpp b/examples/contact-sensor-app/telink/src/AppTask.cpp
index ba6a8d8118a897..dbcf9e1ce48405 100644
--- a/examples/contact-sensor-app/telink/src/AppTask.cpp
+++ b/examples/contact-sensor-app/telink/src/AppTask.cpp
@@ -95,10 +95,10 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
ChipLogProgress(NotSpecified, "StateValue::Set : %d", newValue);
// write the new boolean state value
- EmberAfStatus status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/bdx/DownloadLogCommand.h b/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.h
index ce48270d28b6ac..27bbdd676d4971 100644
--- a/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.h
+++ b/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.h
@@ -32,14 +32,23 @@ class DownloadLogCommand : public CHIPCommandBridge
"The timeout for getting the log. If the timeout expires, completion will be called with whatever has been "
"retrieved by that point (which might be none or a partial log). If the timeout is set to 0, the request will "
"not expire and completion will not be called until the log is fully retrieved or an error occurs.");
+ AddArgument("async", 0, 1, &mIsAsyncCommand,
+ "By default the command waits for the download to finish before returning. If async is true the command will "
+ "not wait and the download will proceed in the background");
+ AddArgument("filepath", &mFilePath, "An optional filepath to save the download log content to.");
}
/////////// CHIPCommandBridge Interface /////////
CHIP_ERROR RunCommand() override;
- chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); }
+ chip::System::Clock::Timeout GetWaitDuration() const override
+ {
+ return chip::System::Clock::Seconds16(mTimeout > 0 ? mTimeout + 10 : 300);
+ }
private:
chip::NodeId mNodeId;
uint8_t mLogType;
uint16_t mTimeout;
+ chip::Optional mFilePath;
+ chip::Optional mIsAsyncCommand;
};
diff --git a/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.mm b/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.mm
index 494ec964f14b63..b105b6cb3098c8 100644
--- a/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.mm
+++ b/examples/darwin-framework-tool/commands/bdx/DownloadLogCommand.mm
@@ -21,6 +21,7 @@
#import "MTRError_Utils.h"
#include "DownloadLogCommand.h"
+#include "RemoteDataModelLogger.h"
CHIP_ERROR DownloadLogCommand::RunCommand()
{
@@ -32,27 +33,62 @@
auto logType = static_cast(mLogType);
auto queue = dispatch_queue_create("com.chip.bdx.downloader", DISPATCH_QUEUE_SERIAL);
+ bool shouldWaitForDownload = !mIsAsyncCommand.ValueOr(false);
+ mIsAsyncCommand.ClearValue();
+
+ bool dumpToFile = mFilePath.HasValue();
+ auto * dumpFilePath = dumpToFile ? [NSString stringWithUTF8String:mFilePath.Value()] : nil;
+ mFilePath.ClearValue();
+
auto * self = this;
auto completion = ^(NSURL * url, NSError * error) {
// A non-nil url indicates the presence of content, which can occur even in error scenarios like timeouts.
+ NSString * logContent = nil;
if (nil != url) {
NSError * readError = nil;
auto * data = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&readError];
- VerifyOrReturn(nil == readError, self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(readError)));
+ if (nil != readError) {
+ if (shouldWaitForDownload) {
+ self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(readError));
+ }
+ return;
+ }
+
+ logContent = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ NSLog(@"Content: %@", logContent);
- auto * content = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- NSLog(@"Content: %@", content);
+ if (dumpToFile) {
+ NSError * writeError = nil;
+ auto * fileManager = [NSFileManager defaultManager];
+ [fileManager copyItemAtPath:[url path] toPath:dumpFilePath error:&writeError];
+ if (nil != writeError) {
+ if (shouldWaitForDownload) {
+ self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(readError));
+ }
+ return;
+ }
+ }
}
- VerifyOrReturn(nil == error, self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(error)));
+ ChipLogProgress(chipTool, "Diagnostic logs transfer: %s", error ? "Error" : "Success");
+ auto err = RemoteDataModelLogger::LogBdxDownload(logContent, error);
- // The url is nil when there are no logs on the target device.
- if (nil == url) {
- NSLog(@"No logs has been found onto node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId));
+ if (CHIP_NO_ERROR != err) {
+ if (shouldWaitForDownload) {
+ self->SetCommandExitStatus(err);
+ }
+ return;
+ }
+
+ if (shouldWaitForDownload) {
+ self->SetCommandExitStatus(MTRErrorToCHIPErrorCode(error));
}
- self->SetCommandExitStatus(CHIP_NO_ERROR);
};
[device downloadLogOfType:logType timeout:mTimeout queue:queue completion:completion];
+
+ if (!shouldWaitForDownload) {
+ SetCommandExitStatus(CHIP_NO_ERROR);
+ }
return CHIP_NO_ERROR;
}
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/darwin-framework-tool/commands/common/RemoteDataModelLogger.h b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h
index 39605e6fb56390..b2cd92df859deb 100644
--- a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h
+++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h
@@ -32,5 +32,6 @@ CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumbe
CHIP_ERROR LogAttributeErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, NSError * error);
CHIP_ERROR LogCommandErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, NSError * error);
CHIP_ERROR LogGetCommissionerNodeId(NSNumber * nodeId);
+CHIP_ERROR LogBdxDownload(NSString * content, NSError * error);
void SetDelegate(RemoteDataModelLoggerDelegate * delegate);
}; // namespace RemoteDataModelLogger
diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm
index 760fe0bc998ed5..ff12cdc022e515 100644
--- a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm
+++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm
@@ -35,6 +35,7 @@
constexpr char kClusterErrorIdKey[] = "clusterError";
constexpr char kValueKey[] = "value";
constexpr char kNodeIdKey[] = "nodeId";
+constexpr char kLogContentIdKey[] = "logContent";
constexpr char kBase64Header[] = "base64:";
@@ -204,5 +205,33 @@ CHIP_ERROR LogGetCommissionerNodeId(NSNumber * value)
return gDelegate->LogJSON(valueStr.c_str());
}
+CHIP_ERROR LogBdxDownload(NSString * content, NSError * error)
+{
+ VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR);
+
+ Json::Value rootValue;
+ rootValue[kValueKey] = Json::Value();
+
+ Json::Value jsonValue;
+ VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(content, jsonValue));
+ rootValue[kValueKey][kLogContentIdKey] = jsonValue;
+
+ if (error) {
+ auto err = MTRErrorToCHIPErrorCode(error);
+ auto status = chip::app::StatusIB(err);
+
+#if CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT
+ auto statusName = chip::Protocols::InteractionModel::StatusName(status.mStatus);
+ rootValue[kValueKey][kErrorIdKey] = statusName;
+#else
+ auto statusName = status.mStatus;
+ rootValue[kValueKey][kErrorIdKey] = chip::to_underlying(statusName);
+#endif // CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT
+ }
+
+ auto valueStr = JsonToString(rootValue);
+ return gDelegate->LogJSON(valueStr.c_str());
+}
+
void SetDelegate(RemoteDataModelLoggerDelegate * delegate) { gDelegate = delegate; }
}; // namespace RemoteDataModelLogger
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/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt
index 3e45d62323cfec..e0a95d584130eb 100644
--- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt
+++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt
@@ -10,6 +10,7 @@ import chip.devicecontroller.model.ChipPathId
import chip.devicecontroller.model.DataVersionFilter
import chip.devicecontroller.model.EventState
import chip.devicecontroller.model.NodeState
+import chip.devicecontroller.model.Status
import com.matter.controller.commands.common.CredentialsIssuer
import java.util.logging.Level
import java.util.logging.Logger
@@ -34,13 +35,6 @@ class PairOnNetworkLongImReadCommand(
eventPath: ChipEventPath?,
e: Exception
) {
- if (attributePath != null && attributePath.clusterId.getId() == UNIT_TEST_CLUSTER) {
- logger.log(
- Level.INFO,
- "TODO: skip the error check for unit test cluster that covers most error result"
- )
- return
- }
logger.log(Level.INFO, "Read receive onError")
setFailure("read failure")
}
@@ -72,11 +66,20 @@ class PairOnNetworkLongImReadCommand(
return cluster.equals(expected)
}
+ fun checkUnitTestClusterGeneralStatus(status: Status): Boolean =
+ (status.getStatus() == CLUSTER_ID_TEST_GENERAL_ERROR_STATUS) &&
+ !status.getClusterStatus().isPresent()
+
+ fun checkUnitTestClusterClusterStatus(status: Status): Boolean =
+ (status.getStatus() == CLUSTER_ID_TEST_CLUSTER_ERROR_STATUS) &&
+ status.getClusterStatus().isPresent() &&
+ status.getClusterStatus().get() == CLUSTER_ID_TEST_CLUSTER_ERROR_CLUSTER_STATUS
+
private fun validateResponse(nodeState: NodeState) {
val endpointZero =
requireNotNull(nodeState.getEndpointState(0)) { "Endpoint zero not found." }
- val endpointOne = requireNotNull(nodeState.getEndpointState(0)) { "Endpoint one not found." }
+ val endpointOne = requireNotNull(nodeState.getEndpointState(1)) { "Endpoint one not found." }
val basicCluster =
requireNotNull(endpointZero.getClusterState(CLUSTER_ID_BASIC)) {
@@ -93,6 +96,11 @@ class PairOnNetworkLongImReadCommand(
"No local config disabled attribute found."
}
+ val unitTestCluster =
+ requireNotNull(endpointOne.getClusterState(UNIT_TEST_CLUSTER)) {
+ "Unit test cluster not found."
+ }
+
val startUpEvents =
requireNotNull(basicCluster.getEventState(EVENT_ID_START_UP)) { "No start up event found." }
@@ -122,6 +130,22 @@ class PairOnNetworkLongImReadCommand(
require(checkAllAttributesJsonForFixedLabel(clusterAttributes)) {
"Invalid fixed label cluster attributes Json ${clusterAttributes}"
}
+
+ require(
+ checkUnitTestClusterGeneralStatus(
+ unitTestCluster.getAttributeStatuses()[CLUSTER_ID_TEST_GENERAL_ERROR_BOOLEAN]!!
+ )
+ ) {
+ "Invalid unit test cluster generalStatus check ${unitTestCluster}"
+ }
+
+ require(
+ checkUnitTestClusterClusterStatus(
+ unitTestCluster.getAttributeStatuses()[CLUSTER_ID_TEST_CLUSTER_ERROR_BOOLEAN]!!
+ )
+ ) {
+ "Invalid unit test cluster clusterStatus check ${unitTestCluster}"
+ }
}
override fun onReport(nodeState: NodeState) {
@@ -212,10 +236,15 @@ class PairOnNetworkLongImReadCommand(
private const val MATTER_PORT = 5540
private const val CLUSTER_ID_BASIC = 0x0028L
private const val FIXED_LABEL_CLUSTER = 0x0040L
- private const val UNIT_TEST_CLUSTER = 0xfff1fc05
+ private const val UNIT_TEST_CLUSTER = 0xfff1fc05L
private const val ATTR_ID_LOCAL_CONFIG_DISABLED = 16L
private const val EVENT_ID_START_UP = 0L
private const val GLOBAL_ATTRIBUTE_LIST = 65531L
private const val CLUSTER_ID_BASIC_VERSION = 0L
+ private const val CLUSTER_ID_TEST_GENERAL_ERROR_BOOLEAN = 0x0031L
+ private const val CLUSTER_ID_TEST_CLUSTER_ERROR_BOOLEAN = 0x0032L
+ private const val CLUSTER_ID_TEST_GENERAL_ERROR_STATUS = 0x8d
+ private const val CLUSTER_ID_TEST_CLUSTER_ERROR_STATUS = 1
+ private const val CLUSTER_ID_TEST_CLUSTER_ERROR_CLUSTER_STATUS = 17
}
}
diff --git a/examples/light-switch-app/ameba/main/BindingHandler.cpp b/examples/light-switch-app/ameba/main/BindingHandler.cpp
index 29acdaae952896..0ffcddc67839eb 100644
--- a/examples/light-switch-app/ameba/main/BindingHandler.cpp
+++ b/examples/light-switch-app/ameba/main/BindingHandler.cpp
@@ -113,7 +113,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast(context);
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -122,7 +122,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -246,7 +246,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -261,7 +261,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
diff --git a/examples/light-switch-app/asr/src/BindingHandler.cpp b/examples/light-switch-app/asr/src/BindingHandler.cpp
index bb2d1d754fc70f..10ee9e2332af30 100644
--- a/examples/light-switch-app/asr/src/BindingHandler.cpp
+++ b/examples/light-switch-app/asr/src/BindingHandler.cpp
@@ -199,7 +199,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & aB
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingData * data = static_cast(context);
- if (aBinding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
+ if (aBinding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
@@ -214,7 +214,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & aB
break;
}
}
- else if (aBinding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
+ else if (aBinding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
@@ -255,7 +255,7 @@ bool BindingHandler::IsGroupBound()
for (auto & entry : bindingTable)
{
- if (EMBER_MULTICAST_BINDING == entry.type)
+ if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
@@ -273,7 +273,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
- case EMBER_UNICAST_BINDING:
+ case MATTER_UNICAST_BINDING:
ASR_LOG("[%d] UNICAST:", i++);
ASR_LOG("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -283,7 +283,7 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
- case EMBER_MULTICAST_BINDING:
+ case MATTER_MULTICAST_BINDING:
ASR_LOG("[%d] GROUP:", i++);
ASR_LOG("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -291,10 +291,10 @@ void BindingHandler::PrintBindingTable()
\t+ GroupId %d",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
- case EMBER_UNUSED_BINDING:
+ case MATTER_UNUSED_BINDING:
ASR_LOG("[%d] UNUSED", i++);
break;
- // case EMBER_MANY_TO_ONE_BINDING:
+ // case MATTER_MANY_TO_ONE_BINDING:
// ASR_LOG("[%d] MANY TO ONE", i++);
// break;
default:
diff --git a/examples/light-switch-app/esp32/main/BindingHandler.cpp b/examples/light-switch-app/esp32/main/BindingHandler.cpp
index 5cc520fd2accd0..9602cd1a534414 100644
--- a/examples/light-switch-app/esp32/main/BindingHandler.cpp
+++ b/examples/light-switch-app/esp32/main/BindingHandler.cpp
@@ -109,7 +109,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast(context);
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -118,7 +118,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -244,7 +244,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -259,7 +259,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
diff --git a/examples/light-switch-app/genio/src/BindingHandler.cpp b/examples/light-switch-app/genio/src/BindingHandler.cpp
index c8392f20ac9c4c..e988464b331afe 100644
--- a/examples/light-switch-app/genio/src/BindingHandler.cpp
+++ b/examples/light-switch-app/genio/src/BindingHandler.cpp
@@ -119,7 +119,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
// Eason+
ChipLogDetail(AppServer, "LightSwitchChangedHandler~~~~~~~");
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -128,7 +128,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -243,7 +243,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -258,7 +258,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
diff --git a/examples/light-switch-app/infineon/cyw30739/src/AppShellCommands.cpp b/examples/light-switch-app/infineon/cyw30739/src/AppShellCommands.cpp
index 477ce99fa44c0b..91cc0c74176a53 100644
--- a/examples/light-switch-app/infineon/cyw30739/src/AppShellCommands.cpp
+++ b/examples/light-switch-app/infineon/cyw30739/src/AppShellCommands.cpp
@@ -361,7 +361,7 @@ CHIP_ERROR GroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->local = 1; // Hardcoded to endpoint 1 for now
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
@@ -379,7 +379,7 @@ CHIP_ERROR UnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 4, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->local = 1; // Hardcoded to endpoint 1 for now
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
diff --git a/examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp b/examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp
index bcf66efb2dd81a..4df68993fddae4 100644
--- a/examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp
+++ b/examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp
@@ -213,7 +213,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
VerifyOrReturn(context != nullptr, printf("Invalid context for Light switch handler\n"););
BindingData * data = static_cast(context);
- if (binding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
@@ -228,7 +228,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
@@ -281,7 +281,7 @@ bool BindingHandler::IsGroupBound()
for (auto & entry : bindingTable)
{
- if (EMBER_MULTICAST_BINDING == entry.type)
+ if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
@@ -299,7 +299,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
- case EMBER_UNICAST_BINDING:
+ case MATTER_UNICAST_BINDING:
printf("[%d] UNICAST:", i++);
printf("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -309,7 +309,7 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
- case EMBER_MULTICAST_BINDING:
+ case MATTER_MULTICAST_BINDING:
printf("[%d] GROUP:", i++);
printf("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -317,7 +317,7 @@ void BindingHandler::PrintBindingTable()
\t+ GroupId %d \n",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
- case EMBER_UNUSED_BINDING:
+ case MATTER_UNUSED_BINDING:
printf("[%d] UNUSED", i++);
break;
default:
diff --git a/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp b/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp
index 852295fffcd23b..a8e252719ae791 100644
--- a/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp
+++ b/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp
@@ -33,7 +33,8 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib
if (attributePath.mAttributeId == Identify::Attributes::IdentifyTime::Id)
{
uint16_t identifyTime;
- if (EMBER_ZCL_STATUS_SUCCESS == Identify::Attributes::IdentifyTime::Get(attributePath.mEndpointId, &identifyTime))
+ if (Protocols::InteractionModel::Status::Success ==
+ Identify::Attributes::IdentifyTime::Get(attributePath.mEndpointId, &identifyTime))
{
ChipLogProgress(Zcl, "IdentifyTime %u", identifyTime);
return;
diff --git a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
index 886637fd21018a..0d93428f8dca5e 100644
--- a/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
+++ b/examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
@@ -198,7 +198,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
VerifyOrReturn(context != nullptr, LOG_ERR("Invalid context for Light switch handler"););
BindingData * data = static_cast(context);
- if (binding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
@@ -213,7 +213,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
@@ -259,7 +259,7 @@ bool BindingHandler::IsGroupBound()
for (auto & entry : bindingTable)
{
- if (EMBER_MULTICAST_BINDING == entry.type)
+ if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
@@ -277,7 +277,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
- case EMBER_UNICAST_BINDING:
+ case MATTER_UNICAST_BINDING:
LOG_INF("[%d] UNICAST:", i++);
LOG_INF("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -287,7 +287,7 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
- case EMBER_MULTICAST_BINDING:
+ case MATTER_MULTICAST_BINDING:
LOG_INF("[%d] GROUP:", i++);
LOG_INF("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
@@ -295,7 +295,7 @@ void BindingHandler::PrintBindingTable()
\t+ GroupId %d",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
- case EMBER_UNUSED_BINDING:
+ case MATTER_UNUSED_BINDING:
LOG_INF("[%d] UNUSED", i++);
break;
default:
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 f02823b178220d..318e61b1e875c8 100644
--- a/examples/light-switch-app/qpg/src/AppTask.cpp
+++ b/examples/light-switch-app/qpg/src/AppTask.cpp
@@ -495,11 +495,12 @@ void AppTask::UpdateClusterState(void)
/* write the new attribute value based on attribute setter API.
example API usage of on-off attribute:
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
+ Protocols::InteractionModel::Status status = Clusters::OnOff::Attributes::OnOff::Set(QPG_LIGHT_ENDPOINT_ID,
+ LightingMgr().IsTurnedOn());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/light-switch-app/qpg/src/binding-handler.cpp b/examples/light-switch-app/qpg/src/binding-handler.cpp
index 6369aa0ab06c25..4dae4e12b44155 100644
--- a/examples/light-switch-app/qpg/src/binding-handler.cpp
+++ b/examples/light-switch-app/qpg/src/binding-handler.cpp
@@ -73,7 +73,7 @@ static void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Op
BindingCommandData * data = static_cast(context);
- if (binding.type == EMBER_UNICAST_BINDING)
+ if (binding.type == MATTER_UNICAST_BINDING)
{
switch (data->clusterId)
{
diff --git a/examples/light-switch-app/silabs/README.md b/examples/light-switch-app/silabs/README.md
index 615b27c7bc3cd9..401e9b88b41fac 100644
--- a/examples/light-switch-app/silabs/README.md
+++ b/examples/light-switch-app/silabs/README.md
@@ -254,22 +254,30 @@ combination with JLinkRTTClient as follows:
[SVR] Copy/paste the below URL in a browser to see the QR Code:
[SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0
- **LED 0** shows the overall state of the device and its connectivity. The
- following states are possible:
+ **LED 0**
- - Short Flash On (50 ms on/950 ms off): The device is in the
+ - ICD Configuration (Default) - LED is only active under two circumstances:
+
+ 1. Factory reset sequence - LED will blink when initiated upon press and hold of
+ Button 0 after 3 seconds
+ 2. An Identify command was received
+
+ - Non-ICD Configuration - shows the overall state of the device and its connectivity. The
+ following states are possible:
+
+ Short Flash On (50 ms on/950 ms off): The device is in the
unprovisioned (unpaired) state and is waiting for a commissioning
application to connect.
- - Rapid Even Flashing (100 ms on/100 ms off): The device is in the
+ Rapid Even Flashing (100 ms on/100 ms off): The device is in the
unprovisioned state and a commissioning application is connected through
Bluetooth LE.
- - Short Flash Off (950ms on/50ms off): The device is fully
+ Short Flash Off (950ms on/50ms off): The device is fully
provisioned, but does not yet have full Thread network or service
connectivity.
- - Solid On: The device is fully provisioned and has full Thread
+ Solid On: The device is fully provisioned and has full Thread
network and service connectivity.
**Push Button 0**
diff --git a/examples/light-switch-app/silabs/openthread.gni b/examples/light-switch-app/silabs/openthread.gni
index 2ea7cd471c2b8a..17cc5885460379 100644
--- a/examples/light-switch-app/silabs/openthread.gni
+++ b/examples/light-switch-app/silabs/openthread.gni
@@ -35,6 +35,6 @@ sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals
sl_ot_active_interval_ms = 500 # 500ms Active Intervals
# ICD Matter Configuration flags
-sl_idle_mode_interval_s = 3600 # 60min Idle Mode Interval
-sl_active_mode_interval_ms = 60000 # 60s Active Mode Interval
+sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration
+sl_active_mode_duration_ms = 60000 # 60s Active Mode Duration
sl_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
diff --git a/examples/light-switch-app/silabs/src/BindingHandler.cpp b/examples/light-switch-app/silabs/src/BindingHandler.cpp
index 3f75f79a60d82c..56f7c306f989d8 100644
--- a/examples/light-switch-app/silabs/src/BindingHandler.cpp
+++ b/examples/light-switch-app/silabs/src/BindingHandler.cpp
@@ -90,7 +90,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast(context);
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -99,7 +99,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
diff --git a/examples/light-switch-app/silabs/src/ShellCommands.cpp b/examples/light-switch-app/silabs/src/ShellCommands.cpp
index daac5078501858..ee5872276efe19 100644
--- a/examples/light-switch-app/silabs/src/ShellCommands.cpp
+++ b/examples/light-switch-app/silabs/src/ShellCommands.cpp
@@ -139,7 +139,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -154,7 +154,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
diff --git a/examples/light-switch-app/telink/src/binding-handler.cpp b/examples/light-switch-app/telink/src/binding-handler.cpp
index f982266828c583..39a8cddc2c60f8 100755
--- a/examples/light-switch-app/telink/src/binding-handler.cpp
+++ b/examples/light-switch-app/telink/src/binding-handler.cpp
@@ -113,7 +113,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
BindingCommandData * data = static_cast(context);
data->isGroup = IsGroupBound();
- if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
+ if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
@@ -122,7 +122,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
- else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
+ else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
@@ -239,7 +239,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_MULTICAST_BINDING;
+ entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -254,7 +254,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
EmberBindingTableEntry * entry = Platform::New();
- entry->type = EMBER_UNICAST_BINDING;
+ entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
@@ -409,7 +409,7 @@ bool IsGroupBound()
for (auto & entry : bindingTable)
{
- if (EMBER_MULTICAST_BINDING == entry.type)
+ if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
diff --git a/examples/lighting-app/asr/src/AppTask.cpp b/examples/lighting-app/asr/src/AppTask.cpp
index e9467d294ef136..b72ff5c8588f31 100755
--- a/examples/lighting-app/asr/src/AppTask.cpp
+++ b/examples/lighting-app/asr/src/AppTask.cpp
@@ -82,13 +82,13 @@ CHIP_ERROR AppTask::StartAppTask()
bool IsLightOn()
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool on = true;
status = app::Clusters::OnOff::Attributes::OnOff::Get(1, &on);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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;
@@ -96,14 +96,14 @@ bool IsLightOn()
uint8_t GetLightLevel()
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
app::DataModel::Nullable currentLevel;
status = app::Clusters::LevelControl::Attributes::CurrentLevel::Get(1, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp
index a0eb17fd747eec..fafc9943e24890 100644
--- a/examples/lighting-app/bouffalolab/common/AppTask.cpp
+++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp
@@ -252,22 +252,25 @@ void AppTask::LightingUpdate(app_event_t status)
{
do
{
- if (EMBER_ZCL_STATUS_SUCCESS != Clusters::OnOff::Attributes::OnOff::Get(endpoint, &onoff))
+ if (Protocols::InteractionModel::Status::Success != Clusters::OnOff::Attributes::OnOff::Get(endpoint, &onoff))
{
break;
}
- if (EMBER_ZCL_STATUS_SUCCESS != Clusters::LevelControl::Attributes::CurrentLevel::Get(endpoint, v))
+ if (Protocols::InteractionModel::Status::Success !=
+ Clusters::LevelControl::Attributes::CurrentLevel::Get(endpoint, v))
{
break;
}
- if (EMBER_ZCL_STATUS_SUCCESS != Clusters::ColorControl::Attributes::CurrentHue::Get(endpoint, &hue))
+ if (Protocols::InteractionModel::Status::Success !=
+ Clusters::ColorControl::Attributes::CurrentHue::Get(endpoint, &hue))
{
break;
}
- if (EMBER_ZCL_STATUS_SUCCESS != Clusters::ColorControl::Attributes::CurrentSaturation::Get(endpoint, &sat))
+ if (Protocols::InteractionModel::Status::Success !=
+ Clusters::ColorControl::Attributes::CurrentSaturation::Get(endpoint, &sat))
{
break;
}
diff --git a/examples/lighting-app/cc13x2x7_26x2x7/BUILD.gn b/examples/lighting-app/cc13x2x7_26x2x7/BUILD.gn
index a745c65a1407cf..1292b5f5e9626c 100644
--- a/examples/lighting-app/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/lighting-app/cc13x2x7_26x2x7/BUILD.gn
@@ -55,7 +55,7 @@ ti_sysconfig("sysconfig") {
]
}
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/lighting-app/cc13x4_26x4/BUILD.gn b/examples/lighting-app/cc13x4_26x4/BUILD.gn
index f4e9ce30d080aa..02d9b0b8763ee7 100644
--- a/examples/lighting-app/cc13x4_26x4/BUILD.gn
+++ b/examples/lighting-app/cc13x4_26x4/BUILD.gn
@@ -63,7 +63,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/lighting-app/esp32/main/AppTask.cpp b/examples/lighting-app/esp32/main/AppTask.cpp
index 33b1505aafc581..562ee4b763faff 100644
--- a/examples/lighting-app/esp32/main/AppTask.cpp
+++ b/examples/lighting-app/esp32/main/AppTask.cpp
@@ -189,18 +189,18 @@ void AppTask::UpdateClusterState()
{
ESP_LOGI(TAG, "Writing to OnOff cluster");
// write the new on/off value
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kLightEndpointId, AppLED.IsTurnedOn());
+ Protocols::InteractionModel::Status status = Clusters::OnOff::Attributes::OnOff::Set(kLightEndpointId, AppLED.IsTurnedOn());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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");
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, AppLED.GetLevel());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/genio/src/ZclCallbacks.cpp b/examples/lighting-app/genio/src/ZclCallbacks.cpp
index 9d0a4d97c09e9b..30faa57990ba7f 100644
--- a/examples/lighting-app/genio/src/ZclCallbacks.cpp
+++ b/examples/lighting-app/genio/src/ZclCallbacks.cpp
@@ -55,7 +55,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
}
else if (clusterId == ColorControl::Id)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
/* ignore several attributes that are currently not processed */
if ((attributeId == ColorControl::Attributes::RemainingTime::Id) ||
(attributeId == ColorControl::Attributes::EnhancedColorMode::Id) ||
diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
index b7fa437127bacb..3af2ffad095f9b 100644
--- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
+++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
@@ -49,12 +49,12 @@ bool LightingManager::IsActionInProgress()
bool LightingManager::IsLightOn(void)
{
- bool on = true;
- const EmberAfStatus status = OnOff::Attributes::OnOff::Get(1, &on);
+ bool on = true;
+ const Protocols::InteractionModel::Status status = OnOff::Attributes::OnOff::Get(1, &on);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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;
@@ -99,20 +99,20 @@ bool LightingManager::InitiateAction(Actor_t aActor, Action_t aAction, uint8_t v
void LightingManager::WriteClusterState(uint8_t value)
{
- const EmberAfStatus status = OnOff::Attributes::OnOff::Set(1, value);
+ const Protocols::InteractionModel::Status status = OnOff::Attributes::OnOff::Set(1, value);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
- printf("Error WriteServerAttribute 0x%02x\n", status);
+ printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status));
}
}
void LightingManager::WriteClusterLevel(uint8_t value)
{
- const EmberAfStatus status = LevelControl::Attributes::CurrentLevel::Set(1, value);
+ const Protocols::InteractionModel::Status status = LevelControl::Attributes::CurrentLevel::Set(1, value);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/cyw30739/src/ZclCallbacks.cpp b/examples/lighting-app/infineon/cyw30739/src/ZclCallbacks.cpp
index 4f0222ca740ca3..0b00eaec57687a 100644
--- a/examples/lighting-app/infineon/cyw30739/src/ZclCallbacks.cpp
+++ b/examples/lighting-app/infineon/cyw30739/src/ZclCallbacks.cpp
@@ -53,7 +53,8 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib
if (attributePath.mAttributeId == Identify::Attributes::IdentifyTime::Id)
{
uint16_t identifyTime;
- if (EMBER_ZCL_STATUS_SUCCESS == Identify::Attributes::IdentifyTime::Get(attributePath.mEndpointId, &identifyTime))
+ if (Protocols::InteractionModel::Status::Success ==
+ Identify::Attributes::IdentifyTime::Get(attributePath.mEndpointId, &identifyTime))
{
ChipLogProgress(Zcl, "IdentifyTime %u", identifyTime);
return;
diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
index 2315086b246594..49e6278ab032c9 100644
--- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
@@ -555,10 +555,10 @@ void AppTask::UpdateClusterState(intptr_t context)
uint8_t newValue = LightMgr().IsLightOn();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/linux/LightingAppCommandDelegate.cpp b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
index cafc1df1161359..e6ac7b3970c148 100644
--- a/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
+++ b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
@@ -259,8 +259,9 @@ void LightingAppCommandHandler::OnSwitchLatchedHandler(uint8_t newPosition)
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The latching switch is moved to a new position:%d", newPosition);
Clusters::SwitchServer::Instance().OnSwitchLatch(endpoint, newPosition);
@@ -270,8 +271,9 @@ void LightingAppCommandHandler::OnSwitchInitialPressedHandler(uint8_t newPositio
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch starts to be pressed:%d", newPosition);
Clusters::SwitchServer::Instance().OnInitialPress(endpoint, newPosition);
@@ -281,8 +283,9 @@ void LightingAppCommandHandler::OnSwitchLongPressedHandler(uint8_t newPosition)
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch has been pressed for a long time:%d", newPosition);
Clusters::SwitchServer::Instance().OnLongPress(endpoint, newPosition);
@@ -292,8 +295,9 @@ void LightingAppCommandHandler::OnSwitchShortReleasedHandler(uint8_t previousPos
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The the previous value of the CurrentPosition when the momentary switch has been released:%d",
previousPosition);
@@ -304,8 +308,9 @@ void LightingAppCommandHandler::OnSwitchLongReleasedHandler(uint8_t previousPosi
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified,
"The the previous value of the CurrentPosition when the momentary switch has been released after having been "
"pressed for a long time:%d",
@@ -318,8 +323,9 @@ void LightingAppCommandHandler::OnSwitchMultiPressOngoingHandler(uint8_t newPosi
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, newPosition);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to set CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The new position when the momentary switch has been pressed in a multi-press sequence:%d",
newPosition);
ChipLogDetail(NotSpecified, "%d times the momentary switch has been pressed", count);
@@ -331,8 +337,9 @@ void LightingAppCommandHandler::OnSwitchMultiPressCompleteHandler(uint8_t previo
{
EndpointId endpoint = 0;
- EmberAfStatus status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
+ Protocols::InteractionModel::Status status = Switch::Attributes::CurrentPosition::Set(endpoint, 0);
+ VerifyOrReturn(Protocols::InteractionModel::Status::Success == status,
+ ChipLogError(NotSpecified, "Failed to reset CurrentPosition attribute"));
ChipLogDetail(NotSpecified, "The previous position when the momentary switch has been pressed in a multi-press sequence:%d",
previousPosition);
ChipLogDetail(NotSpecified, "%d times the momentary switch has been pressed", count);
diff --git a/examples/lighting-app/mbed/main/AppTask.cpp b/examples/lighting-app/mbed/main/AppTask.cpp
index fdbe8ea0cce291..26403bdb5e5b28 100644
--- a/examples/lighting-app/mbed/main/AppTask.cpp
+++ b/examples/lighting-app/mbed/main/AppTask.cpp
@@ -462,18 +462,18 @@ void AppTask::UpdateClusterState()
uint8_t onoff = LightingMgr().IsTurnedOn();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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();
status = app::Clusters::LevelControl::Attributes::CurrentLevel::Set(1, level);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 494095e04de9dc..5eaa1b1b401524 100644
--- a/examples/lighting-app/nrfconnect/main/AppTask.cpp
+++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp
@@ -689,19 +689,20 @@ void AppTask::UpdateClusterState()
{
SystemLayer().ScheduleLambda([this] {
// write the new on/off value
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kLightEndpointId, mPWMDevice.IsTurnedOn());
+ Protocols::InteractionModel::Status status =
+ Clusters::OnOff::Attributes::OnOff::Set(kLightEndpointId, mPWMDevice.IsTurnedOn());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, mPWMDevice.GetLevel());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/nrfconnect/main/ZclCallbacks.cpp b/examples/lighting-app/nrfconnect/main/ZclCallbacks.cpp
index eeb83262bfb804..b872a1c8416d49 100644
--- a/examples/lighting-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/lighting-app/nrfconnect/main/ZclCallbacks.cpp
@@ -73,12 +73,12 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
*/
void emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool storedValue;
// Read storedValue on/off value
status = Attributes::OnOff::Get(endpoint, &storedValue);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Protocols::InteractionModel::Status::Success)
{
// Set actual state to the cluster state that was last persisted
AppTask::Instance().GetPWMDevice().InitiateAction(storedValue ? PWMDevice::ON_ACTION : PWMDevice::OFF_ACTION,
diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
index b1fc51c7c29360..39c9584c883480 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -955,10 +955,10 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
uint8_t newValue = !LightingMgr().IsTurnedOff();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/.gn b/examples/lighting-app/nxp/k32w/k32w1/.gn
index 3d48789e30ab3d..a88f6f5aa7cb3f 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/.gn
+++ b/examples/lighting-app/nxp/k32w/k32w1/.gn
@@ -25,4 +25,7 @@ default_args = {
target_os = "freertos"
import("//args.gni")
+
+ # Import default platform configs
+ import("${chip_root}/src/platform/nxp/k32w/k32w1/args.gni")
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
index a7643a9f847931..2f327213533e94 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
+++ b/examples/lighting-app/nxp/k32w/k32w1/BUILD.gn
@@ -13,15 +13,26 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w1_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
import("//build_overrides/openthread.gni")
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
-import("${k32w1_sdk_build_root}/k32w1_executable.gni")
-import("${k32w1_sdk_build_root}/k32w1_sdk.gni")
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/platform/device.gni")
+import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni")
+
+import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
+
+if (chip_enable_pw_rpc) {
+ import("//build_overrides/pigweed.gni")
+ import("$dir_pw_build/target_types.gni")
+ import("${chip_root}/examples/platform/nxp/pw_rpc_server.gni")
+}
declare_args() {
chip_software_version = 0
@@ -65,12 +76,30 @@ k32w1_sdk("sdk") {
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
]
}
+
+ if (chip_enable_pw_rpc) {
+ defines += [
+ "PW_RPC_ENABLED",
+ "STREAMER_UART_FLUSH_DELAY_MS=0",
+ "STREAMER_UART_SERIAL_MANAGER_RING_BUFFER_SIZE=512",
+ "BOARD_APP_UART_CLK_FREQ=96000000",
+ ]
+ }
}
k32w1_executable("light_app") {
output_name = "chip-k32w1-light-example"
- sources = [
+ sources = []
+ deps = []
+
+ if (chip_enable_pw_rpc) {
+ forward_variables_from(pw_rpc_server, "*")
+ } else {
+ cflags = [ "-Wconversion" ]
+ }
+
+ sources += [
"${k32w1_platform_dir}/util/LEDWidget.cpp",
"${k32w1_platform_dir}/util/include/LEDWidget.h",
"main/AppTask.cpp",
@@ -84,7 +113,7 @@ k32w1_executable("light_app") {
public = [ "${chip_root}/src/platform/nxp/k32w/k32w1/DefaultTestEventTriggerDelegate.h" ]
- deps = [
+ deps += [
":sdk",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/lighting-app/nxp/zap/",
@@ -107,9 +136,7 @@ k32w1_executable("light_app") {
]
}
- cflags = [ "-Wconversion" ]
-
- if (use_smu2_as_system_memory) {
+ if (use_smu2_static) {
ldscript = "${k32w1_platform_dir}/app/ldscripts/k32w1_app.ld"
base_ldscript_dir = "${k32w1_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc"
} else {
@@ -121,13 +148,17 @@ k32w1_executable("light_app") {
ldflags = [
"-Wl,--defsym=__heap_size__=0",
"-Wl,--defsym=__stack_size__=0x480",
- "-Wl,--defsym=gNvmSectors=8",
+ "-Wl,--defsym=gUseFactoryData_d=1",
"-Wl,-print-memory-usage",
"-Wl,--no-warn-rwx-segments",
"-T" + rebase_path(ldscript, root_build_dir),
]
- if (use_smu2_as_system_memory) {
+ if (chip_with_factory_data == 1) {
+ ldflags += [ "-Wl,--defsym=gUseFactoryData_d=1" ]
+ }
+
+ if (use_smu2_static) {
ldflags += [ "-L" + rebase_path(base_ldscript_dir, root_build_dir) ]
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/README.md b/examples/lighting-app/nxp/k32w/k32w1/README.md
index 92dca287111449..253c21e04eafbb 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/README.md
+++ b/examples/lighting-app/nxp/k32w/k32w1/README.md
@@ -22,6 +22,7 @@ into an existing Matter network and can be controlled by this network.
- [Device UI](#device-ui)
- [Building](#building)
- [SMU2](#smu2-memory)
+- [Manufacturing data](#manufacturing-data)
- [Flashing](#flashing)
- [Flashing the NBU image](#flashing-the-nbu-image)
- [Flashing the host image](#flashing-the-host-image)
@@ -33,6 +34,8 @@ into an existing Matter network and can be controlled by this network.
- [Running OTA](#running-ota)
- [Known issues](#known-issues)
+- [Running RPC console](#running-rpc-console)
+
## Introduction
@@ -112,7 +115,8 @@ point before the 6 second limit.
**Button SW3** can be used to change the state of the simulated light bulb. This
can be used to mimic a user manually operating a switch. The button behaves as a
-toggle, swapping the state every time it is pressed.
+toggle, swapping the state every time it is short pressed. When long pressed, it
+does a clean soft reset that takes into account Matter shutdown procedure.
## Building
@@ -147,8 +151,8 @@ see the files prefixed with `chip-k32w1-light-example`.
Some Matter instances and global variables can be placed in the `NBU` `SMU2`
memory. When compiling with OpenThread FTD support (`chip_openthread_ftd=true`)
-and with `use_smu2_as_system_memory=true`, the following components are placed
-in `SMU2` memory:
+and with `use_smu2_static=true`, the following components are placed in `SMU2`
+memory:
- `gImageProcessor` from `OTAImageProcessorImpl.cpp`.
- `gApplicationProcessor` from `OTAHooks.cpp`.
@@ -161,8 +165,18 @@ changed, the names must be updated in `k32w1_app.ld`. See
[k32w1_app.ld](../../../../platform/nxp/k32w/k32w1/app/ldscripts/k32w1_app.ld)
for names and `SMU2` memory range size.
-To use the `SMU2` Memory an optimized `NBU` binary is also needed. See
-[Flashing the NBU image](#flashing-the-nbu-image).
+The OpenThread buffers can be allocated from a 13KB `SMU2` range after a
+successful commissioning process until a factory reset is initiated. This way,
+the OpenThread buffers will be dynamically allocated instead of statically,
+freeing some `SRAM`. To enable this feature compile with OpenThread FTD support
+(`chip_openthread_ftd=true`) and with `use_smu2_dynamic=true`.
+
+## Manufacturing data
+
+Use `chip_with_factory_data=1` in the gn build command to enable factory data.
+
+For a full guide on manufacturing flow, please see
+[Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp_manufacturing_flow.md).
## Flashing
@@ -423,3 +437,22 @@ user@computer1:~/connectedhomeip$ sudo ifconfig eth0 -multicast
- If Wi-Fi is used on a RPI4, then a 5Ghz network should be selected.
Otherwise, issues related to BLE-WiFi combo may appear.
+
+## Running RPC console
+
+To build example with RPC enabled, use the following gn command:
+`gn gen out/debug --args='import("//with_pw_rpc.gni") treat_warnings_as_errors=false'`
+
+The application runs an RPC server and processes events coming from an RPC
+client. An example of an RPC client is the `chip-console`, which can be accessed
+by running:
+`chip-console --device /dev/tty. -b 115200 -o pw_log.out`
+
+The console should already have been installed in the virtual environment. From
+the `chip-console`, a user can send specific commands to the device, e.g.:
+
+- To toggle the LED (`#define LIGHT_BUTTON 2` in `app_config.h`)
+ `rpcs.chip.rpc.Button.Event(idx=2)`
+- To start BLE advertising (`#define BLE_BUTTON 4` in `app_config.h`)
+ `rpcs.chip.rpc.Button.Event(idx=4)`
+- To reboot the device `rpcs.chip.rpc.Device.Reboot()`
diff --git a/examples/lighting-app/nxp/k32w/k32w1/args.gni b/examples/lighting-app/nxp/k32w/k32w1/args.gni
index 4efb6421f5ca02..a06e5828acdc45 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/args.gni
+++ b/examples/lighting-app/nxp/k32w/k32w1/args.gni
@@ -13,7 +13,6 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("${chip_root}/examples/platform/nxp/k32w/k32w1/args.gni")
# SDK target. This is overridden to add our SDK app_config.h & defines.
k32w1_sdk_target = get_label_info(":sdk", "label_no_toolchain")
diff --git a/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
index 07d8b6a92f5e69..536b822d776377 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/include/CHIPProjectConfig.h
@@ -34,6 +34,58 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
+// Use hard-coded test certificates already embedded in generic chip code => set it to 0
+// Use real/development certificates => set it to 1 + file the provisioning section from
+// the internal flash
+#ifndef CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+#define CONFIG_CHIP_LOAD_REAL_FACTORY_DATA 0
+#endif
+
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+
+// VID/PID for product => will be used by Basic Information Cluster
+#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x1037
+#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xA221
+
+// Set the following define to use the Certification Declaration from below and not use it stored in factory data section
+#ifndef CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION
+#define CHIP_USE_DEVICE_CONFIG_CERTIFICATION_DECLARATION 0
+#endif
+
+#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION
+//-> format_version = 1
+//-> vendor_id = 0x1037
+//-> product_id_array = [ 0xA221 ]
+//-> device_type_id = 0x0100
+//-> certificate_id = "ZIG20142ZB330003-24"
+//-> security_level = 0
+//-> security_information = 0
+//-> version_number = 0x2694
+//-> certification_type = 1
+//-> dac_origin_vendor_id is not present
+//-> dac_origin_product_id is not present
+#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \
+ { \
+ 0x30, 0x81, 0xe9, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xdb, 0x30, 0x81, 0xd8, \
+ 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \
+ 0x45, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x38, 0x04, 0x36, 0x15, 0x24, 0x00, \
+ 0x01, 0x25, 0x01, 0x37, 0x10, 0x36, 0x02, 0x05, 0x21, 0xa2, 0x18, 0x25, 0x03, 0x00, 0x01, 0x2c, 0x04, 0x13, 0x5a, \
+ 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, 0x24, \
+ 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x76, 0x98, 0x24, 0x08, 0x01, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, \
+ 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, \
+ 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, \
+ 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0x93, 0x77, \
+ 0x28, 0xd2, 0xd5, 0x36, 0xea, 0x09, 0xe4, 0xc5, 0xbc, 0x87, 0xa5, 0xa2, 0x44, 0x57, 0xf0, 0xed, 0x24, 0x66, 0xe7, \
+ 0x50, 0x61, 0x1b, 0xe1, 0x17, 0x7c, 0x55, 0x0a, 0x83, 0xfa, 0xc3, 0x02, 0x20, 0x21, 0x6c, 0x60, 0x67, 0x4e, 0x3f, \
+ 0xbe, 0x30, 0x38, 0xd4, 0x5e, 0x86, 0x1d, 0xe1, 0xe7, 0x6f, 0x7b, 0x1d, 0xd4, 0xfe, 0xbf, 0x79, 0x5a, 0x4e, 0x07, \
+ 0x83, 0x46, 0xca, 0x94, 0x92, 0x5f, 0x14 \
+ }
+
+// All remaining data will be pulled from the provisioning region of flash.
+#endif
+
+#else
+
/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
@@ -63,6 +115,8 @@
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
+#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+
/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
*
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
index 7150003f599588..2eb2f8e095b8b1 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -30,6 +30,9 @@
#include
#include
#include
+#if defined(USE_SMU2_DYNAMIC)
+#include
+#endif
#include
#include
@@ -88,6 +91,9 @@ using namespace chip;
using namespace chip::app;
AppTask AppTask::sAppTask;
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+static AppTask::FactoryDataProvider sFactoryDataProvider;
+#endif
// This key is for testing/certification only and should not be used in production devices.
// For production devices this key must be provided from factory data.
@@ -135,8 +141,14 @@ CHIP_ERROR AppTask::Init()
// Init ZCL Data Model and start server
PlatformMgr().ScheduleWork(InitServer, 0);
- // Initialize device attestation config
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+ ReturnErrorOnFailure(sFactoryDataProvider.Init());
+ SetDeviceInstanceInfoProvider(&sFactoryDataProvider);
+ SetDeviceAttestationCredentialsProvider(&sFactoryDataProvider);
+ SetCommissionableDataProvider(&sFactoryDataProvider);
+#else
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
+#endif // CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
// QR code will be used with CHIP Tool
AppTask::PrintOnboardingInfo();
@@ -213,6 +225,10 @@ void AppTask::InitServer(intptr_t arg)
initParams.operationalKeystore = &sK32W1PersistentStorageOpKeystore;
#endif
+#if defined(USE_SMU2_DYNAMIC)
+ VerifyOrDie(SMU2::Init(initParams.persistentStorageDelegate) == CHIP_NO_ERROR);
+#endif
+
// Init ZCL Data Model and start server
static DefaultTestEventTriggerDelegate sTestEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) };
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
@@ -339,7 +355,7 @@ void AppTask::AppTaskMain(void * pvParameter)
void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)
{
- if ((pin_no != RESET_BUTTON) && (pin_no != LIGHT_BUTTON) && (pin_no != OTA_BUTTON) && (pin_no != BLE_BUTTON))
+ if ((pin_no != RESET_BUTTON) && (pin_no != LIGHT_BUTTON) && (pin_no != SOFT_RESET_BUTTON) && (pin_no != BLE_BUTTON))
{
return;
}
@@ -353,9 +369,10 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)
{
button_event.Handler = LightActionEventHandler;
}
- else if (pin_no == OTA_BUTTON)
+ else if (pin_no == SOFT_RESET_BUTTON)
{
- // button_event.Handler = OTAHandler;
+ // Soft reset ensures that platform manager shutdown procedure is called.
+ button_event.Handler = SoftResetHandler;
}
else if (pin_no == BLE_BUTTON)
{
@@ -379,7 +396,7 @@ button_status_t AppTask::KBD_Callback(void * buttonHandle, button_callback_messa
switch (pinNb)
{
case BLE_BUTTON:
- K32W_LOG("pb1 short press");
+ // K32W_LOG("pb1 short press");
if (sAppTask.mResetTimerActive)
{
ButtonEventHandler(BLE_BUTTON, RESET_BUTTON_PUSH);
@@ -391,7 +408,7 @@ button_status_t AppTask::KBD_Callback(void * buttonHandle, button_callback_messa
break;
case LIGHT_BUTTON:
- K32W_LOG("pb2 short press");
+ // K32W_LOG("pb2 short press");
ButtonEventHandler(LIGHT_BUTTON, LIGHT_BUTTON_PUSH);
break;
}
@@ -401,13 +418,13 @@ button_status_t AppTask::KBD_Callback(void * buttonHandle, button_callback_messa
switch (pinNb)
{
case BLE_BUTTON:
- K32W_LOG("pb1 long press");
+ // K32W_LOG("pb1 long press");
ButtonEventHandler(BLE_BUTTON, RESET_BUTTON_PUSH);
break;
case LIGHT_BUTTON:
- K32W_LOG("pb2 long press");
- ButtonEventHandler(OTA_BUTTON, OTA_BUTTON_PUSH);
+ // K32W_LOG("pb2 long press");
+ ButtonEventHandler(SOFT_RESET_BUTTON, SOFT_RESET_BUTTON_PUSH);
break;
}
break;
@@ -529,29 +546,14 @@ void AppTask::LightActionEventHandler(AppEvent * aEvent)
}
}
-void AppTask::OTAHandler(AppEvent * aEvent)
+void AppTask::SoftResetHandler(AppEvent * aEvent)
{
- if (aEvent->ButtonEvent.PinNo != OTA_BUTTON)
+ if (aEvent->ButtonEvent.PinNo != SOFT_RESET_BUTTON)
return;
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
- if (sAppTask.mFunction != kFunction_NoneSelected)
- {
- K32W_LOG("Another function is scheduled. Could not initiate OTA!");
- return;
- }
-
- PlatformMgr().ScheduleWork(StartOTAQuery, 0);
-#endif
+ PlatformMgrImpl().CleanReset();
}
-#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
-void AppTask::StartOTAQuery(intptr_t arg)
-{
- GetRequestorInstance()->TriggerImmediateQuery();
-}
-#endif
-
void AppTask::BleHandler(AppEvent * aEvent)
{
if (aEvent->ButtonEvent.PinNo != BLE_BUTTON)
@@ -807,11 +809,24 @@ void AppTask::PostTurnOnActionRequest(int32_t aActor, LightingManager::Action_t
void AppTask::PostEvent(const AppEvent * aEvent)
{
+ portBASE_TYPE taskToWake = pdFALSE;
if (sAppEventQueue != NULL)
{
- if (!xQueueSend(sAppEventQueue, aEvent, 1))
+ if (__get_IPSR())
+ {
+ if (!xQueueSendToFrontFromISR(sAppEventQueue, aEvent, &taskToWake))
+ {
+ K32W_LOG("Failed to post event to app task event queue");
+ }
+
+ portYIELD_FROM_ISR(taskToWake);
+ }
+ else
{
- K32W_LOG("Failed to post event to app task event queue");
+ if (!xQueueSend(sAppEventQueue, aEvent, 1))
+ {
+ K32W_LOG("Failed to post event to app task event queue");
+ }
}
}
}
@@ -838,10 +853,10 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
uint8_t newValue = !LightingMgr().IsTurnedOff();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/include/AppTask.h b/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
index db81edf168c41e..b5201da2477862 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/include/AppTask.h
@@ -27,6 +27,10 @@
#include
#include
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+#include
+#endif
+
#include "FreeRTOS.h"
#include "fsl_component_button.h"
#include "timers.h"
@@ -42,6 +46,9 @@
class AppTask
{
public:
+#if CONFIG_CHIP_LOAD_REAL_FACTORY_DATA
+ using FactoryDataProvider = chip::DeviceLayer::FactoryDataProviderImpl;
+#endif
CHIP_ERROR StartAppTask();
static void AppTaskMain(void * pvParameter);
@@ -56,6 +63,7 @@ class AppTask
static void OnIdentifyStop(Identify * identify);
static void OnTriggerEffect(Identify * identify);
static void OnTriggerEffectComplete(chip::System::Layer * systemLayer, void * appState);
+ static void ButtonEventHandler(uint8_t pin_no, uint8_t button_action);
private:
friend AppTask & GetAppTask(void);
@@ -71,14 +79,13 @@ class AppTask
static void FunctionTimerEventHandler(AppEvent * aEvent);
static button_status_t KBD_Callback(void * buttonHandle, button_callback_message_t * message, void * callbackParam);
- static void OTAHandler(AppEvent * aEvent);
+ static void SoftResetHandler(AppEvent * aEvent);
static void BleHandler(AppEvent * aEvent);
static void BleStartAdvertising(intptr_t arg);
static void LightActionEventHandler(AppEvent * aEvent);
static void ResetActionEventHandler(AppEvent * aEvent);
static void InstallEventHandler(AppEvent * aEvent);
- static void ButtonEventHandler(uint8_t pin_no, uint8_t button_action);
static void TimerEventHandler(TimerHandle_t xTimer);
static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/include/app_config.h b/examples/lighting-app/nxp/k32w/k32w1/main/include/app_config.h
index ff938f494b089d..1478b53b11aba1 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/include/app_config.h
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/include/app_config.h
@@ -22,12 +22,12 @@
#define RESET_BUTTON 1
#define LIGHT_BUTTON 2
-#define OTA_BUTTON 3
+#define SOFT_RESET_BUTTON 3
#define BLE_BUTTON 4
#define RESET_BUTTON_PUSH 1
#define LIGHT_BUTTON_PUSH 2
-#define OTA_BUTTON_PUSH 3
+#define SOFT_RESET_BUTTON_PUSH 3
#define BLE_BUTTON_PUSH 4
#define APP_BUTTON_PUSH 1
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/main.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/main.cpp
index 7ebd3f3ed3b1b7..53a6efbbb3ffd5 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/main.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/main.cpp
@@ -35,6 +35,7 @@
#include "FreeRtosHooks.h"
#include "app_config.h"
+#include "pin_mux.h"
using namespace ::chip;
using namespace ::chip::Inet;
@@ -43,6 +44,10 @@ using namespace ::chip::Logging;
#include
+#if PW_RPC_ENABLED
+#include "Rpc.h"
+#endif
+
typedef void (*InitFunc)(void);
extern InitFunc __init_array_start;
extern InitFunc __init_array_end;
@@ -69,6 +74,17 @@ extern "C" void main_task(void const * argument)
/* Used for HW initializations */
otSysInit(0, NULL);
+#if PW_RPC_ENABLED
+ /* set clock */
+ CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro192M);
+ /* enable clock */
+ CLOCK_EnableClock(kCLOCK_Lpuart1);
+
+ BOARD_InitPinLPUART1_TX();
+ BOARD_InitPinLPUART1_RX();
+ chip::rpc::Init();
+#endif
+
K32W_LOG("Welcome to NXP Lighting Demo App");
/* Mbedtls Threading support is needed because both
diff --git a/examples/lighting-app/nxp/k32w/k32w1/with_pw_rpc.gni b/examples/lighting-app/nxp/k32w/k32w1/with_pw_rpc.gni
new file mode 100644
index 00000000000000..d6bea63f8402c0
--- /dev/null
+++ b/examples/lighting-app/nxp/k32w/k32w1/with_pw_rpc.gni
@@ -0,0 +1,33 @@
+# 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.
+
+# add this gni as import in your build args to use pigweed in the example
+# 'import("//with_pw_rpc.gni")'
+
+import("//build_overrides/chip.gni")
+import("${chip_root}/config/nxp/lib/pw_rpc/pw_rpc.gni")
+import("${chip_root}/examples/platform/nxp/k32w/k32w1/args.gni")
+
+k32w1_sdk_target = get_label_info(":sdk", "label_no_toolchain")
+
+chip_enable_ota_requestor = true
+chip_stack_lock_tracking = "fatal"
+chip_enable_ble = true
+chip_enable_pw_rpc = true
+chip_with_ot_cli = 0
+is_debug = false
+chip_openthread_ftd = true
+chip_crypto = "platform"
+
+cpp_standard = "gnu++17"
diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter
index 9f4e9c51e5e5c3..5241ba629863ab 100644
--- a/examples/lighting-app/nxp/zap/lighting-on-off.matter
+++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter
@@ -1522,7 +1522,7 @@ cluster GroupKeyManagement = 63 {
}
endpoint 0 {
- device type ma_rootdevice = 22, version 1;
+ device type ma_rootdevice = 22, version 2;
binding cluster OtaSoftwareUpdateProvider;
diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap
index e7f1d48c378d29..8873c5e9732c85 100644
--- a/examples/lighting-app/nxp/zap/lighting-on-off.zap
+++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap
@@ -51,7 +51,7 @@
}
],
"deviceVersions": [
- 1
+ 2
],
"deviceIdentifiers": [
22
@@ -3994,5 +3994,6 @@
"endpointId": 1,
"networkId": 0
}
- ]
+ ],
+ "log": []
}
\ No newline at end of file
diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp
index 4dafde6ac41960..2bc0ffafec5d2a 100644
--- a/examples/lighting-app/qpg/src/AppTask.cpp
+++ b/examples/lighting-app/qpg/src/AppTask.cpp
@@ -642,18 +642,19 @@ void AppTask::UpdateClusterState(void)
ChipLogProgress(NotSpecified, "UpdateClusterState");
// Write the new on/off value
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
+ Protocols::InteractionModel::Status status =
+ Clusters::OnOff::Attributes::OnOff::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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/qpg/src/ZclCallbacks.cpp b/examples/lighting-app/qpg/src/ZclCallbacks.cpp
index 0b75837a64a8cc..e2255bd4e76684 100644
--- a/examples/lighting-app/qpg/src/ZclCallbacks.cpp
+++ b/examples/lighting-app/qpg/src/ZclCallbacks.cpp
@@ -78,15 +78,15 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
{
xy.x = *reinterpret_cast(value);
// get Y from cluster value storage
- EmberAfStatus status = ColorControl::Attributes::CurrentY::Get(endpoint, &xy.y);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Protocols::InteractionModel::Status status = ColorControl::Attributes::CurrentY::Get(endpoint, &xy.y);
+ assert(status == Protocols::InteractionModel::Status::Success);
}
if (attributeId == ColorControl::Attributes::CurrentY::Id)
{
xy.y = *reinterpret_cast(value);
// get X from cluster value storage
- EmberAfStatus status = ColorControl::Attributes::CurrentX::Get(endpoint, &xy.x);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Protocols::InteractionModel::Status status = ColorControl::Attributes::CurrentX::Get(endpoint, &xy.x);
+ assert(status == Protocols::InteractionModel::Status::Success);
}
ChipLogProgress(Zcl, "New XY color: %u|%u", xy.x, xy.y);
@@ -108,22 +108,22 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
// We only support 8-bit hue. Assuming hue is linear, normalize 16-bit to 8-bit.
hsv.h = (uint8_t) ((*reinterpret_cast(value)) >> 8);
// get saturation from cluster value storage
- EmberAfStatus status = ColorControl::Attributes::CurrentSaturation::Get(endpoint, &hsv.s);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Protocols::InteractionModel::Status status = ColorControl::Attributes::CurrentSaturation::Get(endpoint, &hsv.s);
+ assert(status == Protocols::InteractionModel::Status::Success);
}
else if (attributeId == ColorControl::Attributes::CurrentHue::Id)
{
hsv.h = *value;
// get saturation from cluster value storage
- EmberAfStatus status = ColorControl::Attributes::CurrentSaturation::Get(endpoint, &hsv.s);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Protocols::InteractionModel::Status status = ColorControl::Attributes::CurrentSaturation::Get(endpoint, &hsv.s);
+ assert(status == Protocols::InteractionModel::Status::Success);
}
else if (attributeId == ColorControl::Attributes::CurrentSaturation::Id)
{
hsv.s = *value;
// get hue from cluster value storage
- EmberAfStatus status = ColorControl::Attributes::CurrentHue::Get(endpoint, &hsv.h);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Protocols::InteractionModel::Status status = ColorControl::Attributes::CurrentHue::Get(endpoint, &hsv.h);
+ assert(status == Protocols::InteractionModel::Status::Success);
}
ChipLogProgress(Zcl, "New HSV color: %u|%u", hsv.h, hsv.s);
LightingMgr().InitiateAction(LightingManager::COLOR_ACTION_HSV, 0, sizeof(hsv), (uint8_t *) &hsv);
@@ -164,11 +164,11 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
XyColor_t xy;
bool onOffValue = false;
app::DataModel::Nullable currentLevel;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
status = OnOff::Attributes::OnOff::Get(1, &onOffValue);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Protocols::InteractionModel::Status::Success)
{
LightingMgr().InitiateAction(onOffValue ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION, 0, 1,
(uint8_t *) onOffValue);
@@ -176,7 +176,7 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
/* restore values saved by DeferredAttributePersistenceProvider */
status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+ if (status != Protocols::InteractionModel::Status::Success || currentLevel.IsNull())
{
return;
}
@@ -184,12 +184,12 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint)
levelValue = currentLevel.Value();
status = ColorControl::Attributes::CurrentY::Get(endpoint, &xy.y);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
return;
}
status = ColorControl::Attributes::CurrentX::Get(endpoint, &xy.x);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
return;
}
diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp
index 542dc2fbfd55c8..bce7b06cb5cb07 100644
--- a/examples/lighting-app/silabs/src/AppTask.cpp
+++ b/examples/lighting-app/silabs/src/AppTask.cpp
@@ -246,10 +246,10 @@ void AppTask::UpdateClusterState(intptr_t context)
uint8_t newValue = LightMgr().IsLightOn();
// write the new on/off value
- EmberAfStatus status = OnOffServer::Instance().setOnOffValue(1, newValue, false);
+ Protocols::InteractionModel::Status status = OnOffServer::Instance().setOnOffValue(1, newValue, false);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 4b9d5427adc8f4..d102f8a9dfd421 100644
--- a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
+++ b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
@@ -444,17 +444,18 @@ void AppTask::UpdateClusterState(void)
{
ChipLogProgress(NotSpecified, "UpdateClusterState");
// Write the new on/off value
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Protocols::InteractionModel::Status status =
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 fde4a836c90886..54dd2703c16ce9 100644
--- a/examples/lighting-app/telink/src/AppTask.cpp
+++ b/examples/lighting-app/telink/src/AppTask.cpp
@@ -204,7 +204,7 @@ void AppTask::ActionCompleted(PWMDevice::Action_t aAction, int32_t aActor)
void AppTask::UpdateClusterState(void)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool isTurnedOn;
uint8_t setLevel;
@@ -240,15 +240,15 @@ void AppTask::UpdateClusterState(void)
// write the new on/off value
status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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/telink/src/ZclCallbacks.cpp b/examples/lighting-app/telink/src/ZclCallbacks.cpp
index 53649639507142..7aebb1ba69bae1 100644
--- a/examples/lighting-app/telink/src/ZclCallbacks.cpp
+++ b/examples/lighting-app/telink/src/ZclCallbacks.cpp
@@ -130,12 +130,12 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
*/
void emberAfOnOffClusterInitCallback(EndpointId endpoint)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool storedValue;
// Read storedValue on/off value
status = Attributes::OnOff::Get(1, &storedValue);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Protocols::InteractionModel::Status::Success)
{
// Set actual state to stored before reboot
GetAppTask().GetLightingDevice().Set(storedValue);
diff --git a/examples/lighting-app/tizen/BUILD.gn b/examples/lighting-app/tizen/BUILD.gn
index c0a38e7c113a91..66b508b74e3284 100644
--- a/examples/lighting-app/tizen/BUILD.gn
+++ b/examples/lighting-app/tizen/BUILD.gn
@@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/tizen.gni")
+import("${build_root}/config/linux/pkg_config.gni")
import("${chip_root}/build/chip/linux/gdbus_library.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/common_flags.gni")
@@ -27,6 +29,10 @@ declare_args() {
chip_examples_enable_ui = false
}
+pkg_config("capi-system-peripheral-io") {
+ packages = [ "capi-system-peripheral-io" ]
+}
+
gdbus_library("chip-lighting-app-manager") {
sources = [ "xml/DBusLightApp.xml" ]
interface_prefix = "org.tizen.matter.example.lighting"
@@ -50,6 +56,8 @@ executable("chip-lighting-app") {
"${chip_root}/src/lib",
]
+ configs += [ ":capi-system-peripheral-io" ]
+
if (chip_examples_enable_ui) {
sources += [ "src/DBusInterface.cpp" ]
deps += [ ":chip-lighting-app-manager" ]
diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp
index 7c6e29d6a1cc38..e39ca5c1e1232c 100644
--- a/examples/lighting-app/tizen/src/DBusInterface.cpp
+++ b/examples/lighting-app/tizen/src/DBusInterface.cpp
@@ -206,7 +206,8 @@ void DBusInterface::InitOnOff()
{
bool isOn = false;
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
- VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
+ VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
+ ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status)));
light_app_on_off_set_on_off(mIfaceOnOff, isOn);
}
@@ -215,14 +216,15 @@ void DBusInterface::InitColor()
{
uint8_t value = 0;
auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value);
- VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", status));
+ VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
+ 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 == EMBER_ZCL_STATUS_SUCCESS,
- ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", status));
+ VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
+ 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 0848675c7c0fef..474ba612287f16 100644
--- a/examples/lighting-app/tizen/src/LedManager.cpp
+++ b/examples/lighting-app/tizen/src/LedManager.cpp
@@ -62,7 +62,8 @@ void LedManager::InitOnOff()
{
bool isOn = false;
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
- VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
+ VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
+ 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/README.md b/examples/lit-icd-app/silabs/README.md
index f359eacbd23cf4..07ec9c320bcb36 100644
--- a/examples/lit-icd-app/silabs/README.md
+++ b/examples/lit-icd-app/silabs/README.md
@@ -241,22 +241,30 @@ combination with JLinkRTTClient as follows:
[SVR] Copy/paste the below URL in a browser to see the QR Code:
[SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0
- **LED 0** shows the overall state of the device and its connectivity. The
- following states are possible:
+ **LED 0**
- - Short Flash On (50 ms on/950 ms off): The device is in the
+ - ICD Configuration (Default) - LED is only active under two circumstances:
+
+ 1. Factory reset sequence - LED will blink when initiated upon press and hold of
+ Button 0 after 3 seconds
+ 2. An Identify command was received
+
+ - Non-ICD Configuration - shows the overall state of the device and its connectivity. The
+ following states are possible:
+
+ Short Flash On (50 ms on/950 ms off): The device is in the
unprovisioned (unpaired) state and is waiting for a commissioning
application to connect.
- - Rapid Even Flashing (100 ms on/100 ms off): The device is in the
+ Rapid Even Flashing (100 ms on/100 ms off): The device is in the
unprovisioned state and a commissioning application is connected through
Bluetooth LE.
- - Short Flash Off (950ms on/50ms off): The device is fully
+ Short Flash Off (950ms on/50ms off): The device is fully
provisioned, but does not yet have full Thread network or service
connectivity.
- - Solid On: The device is fully provisioned and has full Thread
+ Solid On: The device is fully provisioned and has full Thread
network and service connectivity.
**Push Button 0**
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 630cb65b53f45d..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,8 +28,9 @@ 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_interval_s = 3600 # 60min Idle Mode Interval
-sl_active_mode_interval_ms = 0 # 0 Active Mode Interval
+sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration
+sl_active_mode_duration_ms = 0 # 0 Active Mode Duration
sl_active_mode_threshold_ms = 30000 # 30s Active Mode Threshold
diff --git a/examples/lit-icd-app/silabs/openthread.gni b/examples/lit-icd-app/silabs/openthread.gni
index 69bd7b88e6bdc6..9d06737d622a2d 100644
--- a/examples/lit-icd-app/silabs/openthread.gni
+++ b/examples/lit-icd-app/silabs/openthread.gni
@@ -32,12 +32,13 @@ 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
sl_ot_active_interval_ms = 1000 # 1000ms Active Polling Interval
# ICD Matter Configuration flags
-sl_idle_mode_interval_s = 3600 # 60min Idle Mode Interval
-sl_active_mode_interval_ms = 0 # 0 Active Mode Interval
+sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration
+sl_active_mode_duration_ms = 0 # 0 Active Mode Duration
sl_active_mode_threshold_ms = 5000 # 5s Active Mode Threshold
diff --git a/examples/lock-app/asr/src/AppTask.cpp b/examples/lock-app/asr/src/AppTask.cpp
old mode 100755
new mode 100644
index 36d53399a991f1..a90d0013761324
--- a/examples/lock-app/asr/src/AppTask.cpp
+++ b/examples/lock-app/asr/src/AppTask.cpp
@@ -480,11 +480,12 @@ void AppTask::UpdateCluster(intptr_t context)
OperationSourceEnum source = OperationSourceEnum::kUnspecified;
// write the new lock value
- EmberAfStatus status =
- DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Protocols::InteractionModel::Status status = DoorLockServer::Instance().SetLockState(1, newState, source)
+ ? Protocols::InteractionModel::Status::Success
+ : 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/cc13x2x7_26x2x7/BUILD.gn b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
index db4f599aad8f79..8cf4f38dc771f2 100644
--- a/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
@@ -55,7 +55,7 @@ ti_sysconfig("sysconfig") {
]
}
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/lock-app/cc13x4_26x4/BUILD.gn b/examples/lock-app/cc13x4_26x4/BUILD.gn
index 67560cd7469f41..aed45f85bce94b 100644
--- a/examples/lock-app/cc13x4_26x4/BUILD.gn
+++ b/examples/lock-app/cc13x4_26x4/BUILD.gn
@@ -59,7 +59,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp
index e6a8519b782c18..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
@@ -468,9 +468,9 @@ void AppTask::UpdateClusterState(intptr_t context)
uint8_t newValue = !BoltLockMgr().IsUnlocked();
// write the new on/off value
- EmberAfStatus status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 2b331d3cfafd33..7a438dd4974d3d 100644
--- a/examples/lock-app/genio/src/AppTask.cpp
+++ b/examples/lock-app/genio/src/AppTask.cpp
@@ -596,11 +596,12 @@ void AppTask::UpdateClusterState(intptr_t context)
OperationSourceEnum source = OperationSourceEnum::kUnspecified;
// write the new lock value
- EmberAfStatus status =
- DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
+ Protocols::InteractionModel::Status status = DoorLockServer::Instance().SetLockState(1, newState, source)
+ ? Protocols::InteractionModel::Status::Success
+ : Protocols::InteractionModel::Status::Failure;
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 12688358f0feee..88ebaf641d86c7 100644
--- a/examples/lock-app/genio/src/ZclCallbacks.cpp
+++ b/examples/lock-app/genio/src/ZclCallbacks.cpp
@@ -61,45 +61,45 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
*/
void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
status = DoorLock::Attributes::LockType::Set(endpoint, DlLockType::kDeadBolt);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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
// at the same time.
// Set FeatureMap to (kUser|kPinCredential)
status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0x101);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 a0a92487a807bc..c82cc894bae5af 100644
--- a/examples/lock-app/infineon/cyw30739/src/main.cpp
+++ b/examples/lock-app/infineon/cyw30739/src/main.cpp
@@ -324,12 +324,13 @@ void UpdateClusterState(intptr_t context)
OperationSourceEnum source = OperationSourceEnum::kUnspecified;
// write the new lock value
- EmberAfStatus status =
- DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
+ Protocols::InteractionModel::Status status = DoorLockServer::Instance().SetLockState(1, newState, source)
+ ? Protocols::InteractionModel::Status::Success
+ : Protocols::InteractionModel::Status::Failure;
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 e3be287e024442..9f29e32e6c618a 100644
--- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp
@@ -660,11 +660,12 @@ void AppTask::UpdateCluster(intptr_t context)
OperationSourceEnum source = OperationSourceEnum::kUnspecified;
// write the new lock value
- EmberAfStatus status =
- DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Protocols::InteractionModel::Status status = DoorLockServer::Instance().SetLockState(1, newState, source)
+ ? Protocols::InteractionModel::Status::Success
+ : 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 4e1d0c70e943cc..2dd5a4463dcf74 100644
--- a/examples/lock-app/mbed/main/AppTask.cpp
+++ b/examples/lock-app/mbed/main/AppTask.cpp
@@ -461,9 +461,9 @@ void AppTask::UpdateClusterState()
uint8_t newValue = !BoltLockMgr().IsUnlocked();
// write the new on/off value
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 99ea77ee21adb9..63040970d9b9df 100644
--- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
@@ -112,10 +112,10 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
{
DoorLockServer::Instance().InitServer(endpoint);
- const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) {
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 130569791e2e8e..7c6cffaf968c02 100644
--- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -777,11 +777,11 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
}
// write the new door lock state
- EmberAfStatus status = Attributes::LockState::Set(1, newValue);
+ chip::Protocols::InteractionModel::Status status = Attributes::LockState::Set(1, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 54a4b2a5d2a3f3..7f9d922cc8558d 100644
--- a/examples/lock-app/qpg/src/AppTask.cpp
+++ b/examples/lock-app/qpg/src/AppTask.cpp
@@ -622,10 +622,10 @@ void AppTask::UpdateClusterState(void)
if (currentLockState.IsNull())
{
- EmberAfStatus status = DoorLock::Attributes::LockState::Set(QPG_LOCK_ENDPOINT_ID, newValue);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 51751c43ed4058..05518bff13cabd 100644
--- a/examples/lock-app/qpg/src/ZclCallbacks.cpp
+++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp
@@ -114,10 +114,10 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
{
DoorLockServer::Instance().InitServer(endpoint);
- const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) {
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/README.md b/examples/lock-app/silabs/README.md
index 1bce8c431bee54..447fe3b9949995 100644
--- a/examples/lock-app/silabs/README.md
+++ b/examples/lock-app/silabs/README.md
@@ -262,22 +262,30 @@ combination with JLinkRTTClient as follows:
[SVR] Copy/paste the below URL in a browser to see the QR Code:
[SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0
- **LED 0** shows the overall state of the device and its connectivity. The
- following states are possible:
+ **LED 0**
- - _Short Flash On (50 ms on/950 ms off)_ ; The device is in the
+ - ICD Configuration (Default) - LED is only active under two circumstances:
+
+ 1. Factory reset sequence - LED will blink when initiated upon press and hold of
+ Button 0 after 3 seconds
+ 2. An Identify command was received
+
+ - Non-ICD Configuration - shows the overall state of the device and its connectivity. The
+ following states are possible:
+
+ Short Flash On (50 ms on/950 ms off): The device is in the
unprovisioned (unpaired) state and is waiting for a commissioning
application to connect.
- - _Rapid Even Flashing_ ; (100 ms on/100 ms off)_ — The device is in the
+ Rapid Even Flashing (100 ms on/100 ms off): The device is in the
unprovisioned state and a commissioning application is connected through
Bluetooth LE.
- - _Short Flash Off_ ; (950ms on/50ms off)_ — The device is fully
+ Short Flash Off (950ms on/50ms off): The device is fully
provisioned, but does not yet have full Thread network or service
connectivity.
- - _Solid On_ ; The device is fully provisioned and has full Thread
+ Solid On: The device is fully provisioned and has full Thread
network and service connectivity.
**LED 1** Simulates the Lock The following states are possible:
diff --git a/examples/lock-app/silabs/build_for_wifi_args.gni b/examples/lock-app/silabs/build_for_wifi_args.gni
index a9a7ee66170687..25c5a2435d332f 100644
--- a/examples/lock-app/silabs/build_for_wifi_args.gni
+++ b/examples/lock-app/silabs/build_for_wifi_args.gni
@@ -27,6 +27,6 @@ chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
# ICD Matter Configuration flags
-sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval
-sl_active_mode_interval_ms = 10000 # 10s Active Mode Interval
+sl_idle_mode_duration_s = 600 # 10min Idle Mode Duration
+sl_active_mode_duration_ms = 10000 # 10s Active Mode Duration
sl_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
diff --git a/examples/lock-app/silabs/openthread.gni b/examples/lock-app/silabs/openthread.gni
index cde56f8029f6da..3bfa566596aeaf 100644
--- a/examples/lock-app/silabs/openthread.gni
+++ b/examples/lock-app/silabs/openthread.gni
@@ -35,6 +35,6 @@ sl_ot_idle_interval_ms = 5000 # 5s Idle Intervals
sl_ot_active_interval_ms = 500 # 500ms Active Intervals
# ICD Matter Configuration flags
-sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval
-sl_active_mode_interval_ms = 10000 # 10s Active Mode Interval
+sl_idle_mode_duration_s = 600 # 10min Idle Mode Duration
+sl_active_mode_duration_ms = 10000 # 10s Active Mode Duration
sl_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
diff --git a/examples/lock-app/silabs/src/AppTask.cpp b/examples/lock-app/silabs/src/AppTask.cpp
index 4e8527f4f4fa1a..2510fa7f351c03 100644
--- a/examples/lock-app/silabs/src/AppTask.cpp
+++ b/examples/lock-app/silabs/src/AppTask.cpp
@@ -353,11 +353,12 @@ void AppTask::UpdateClusterState(intptr_t context)
DlLockState newState = unlocked ? DlLockState::kUnlocked : DlLockState::kLocked;
// write the new lock value
- EmberAfStatus status =
- DoorLockServer::Instance().SetLockState(1, newState) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
+ Protocols::InteractionModel::Status status = DoorLockServer::Instance().SetLockState(1, newState)
+ ? Protocols::InteractionModel::Status::Success
+ : Protocols::InteractionModel::Status::Failure;
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/persistent-storage/cc13x2x7_26x2x7/BUILD.gn b/examples/persistent-storage/cc13x2x7_26x2x7/BUILD.gn
index ea0acea00155be..0a8930dff1adb2 100644
--- a/examples/persistent-storage/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/persistent-storage/cc13x2x7_26x2x7/BUILD.gn
@@ -46,7 +46,7 @@ ti_sysconfig("sysconfig") {
"ti_drivers_config.h",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/platform/asr/shell/matter_shell.cpp b/examples/platform/asr/shell/matter_shell.cpp
index dcd412af5f033e..bfa138f92ff0e5 100644
--- a/examples/platform/asr/shell/matter_shell.cpp
+++ b/examples/platform/asr/shell/matter_shell.cpp
@@ -83,12 +83,12 @@ void asr_matter_onoff(int value)
{
ChipLogProgress(Zcl, "updating on/off = %d", value);
- EmberAfStatus status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(
+ Protocols::InteractionModel::Status status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(
/* endpoint ID */ 1, (uint8_t *) &value);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/platform/nxp/PigweedLogger.cpp b/examples/platform/nxp/PigweedLogger.cpp
new file mode 100644
index 00000000000000..8e7bf277e320fb
--- /dev/null
+++ b/examples/platform/nxp/PigweedLogger.cpp
@@ -0,0 +1,111 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * @file PigweedLogger.cpp
+ *
+ * This file contains basic string writing function, based on Pigweed HDLC
+ * over UART transport. It allows to send log messages even if the application
+ * needs to use HDLC/UART for another purpose like the RPC server.
+ */
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include "PigweedLogger.h"
+
+namespace PigweedLogger {
+namespace {
+
+constexpr uint8_t kLogHdlcAddress = 1; // Send log messages to HDLC address 1 (other than RPC communication)
+constexpr size_t kWriteBufferSize = 256; // Buffer for constructing HDLC frames
+
+// Exclusive access to the backend is needed to make sure that log messages coming
+// from different threads are not interwoven.
+SemaphoreHandle_t sLoggerLock;
+
+static pw::stream::SysIoWriter sWriter;
+static size_t sWriteBufferPos;
+static char sWriteBuffer[kWriteBufferSize];
+
+static void send(void)
+{
+ pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
+ sWriteBufferPos = 0;
+}
+
+} // namespace
+
+void Init(void)
+{
+ sLoggerLock = xSemaphoreCreateMutex();
+ assert(sLoggerLock != NULL);
+
+ pw_sys_io_Init();
+}
+
+int PutString(const char * buffer, size_t size)
+{
+ assert(sWriteBufferPos < kWriteBufferSize);
+ assert(size < kWriteBufferSize);
+
+ Lock();
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ // Send each line excluding "\r\n" in a separate frame
+
+ if (buffer[i] == '\r')
+ continue;
+
+ if (buffer[i] == '\n')
+ {
+ send();
+ continue;
+ }
+
+ sWriteBuffer[sWriteBufferPos++] = buffer[i];
+
+ if (sWriteBufferPos == kWriteBufferSize)
+ send();
+ }
+
+ Unlock();
+
+ return size;
+}
+
+void Lock()
+{
+ xSemaphoreTake(sLoggerLock, portMAX_DELAY);
+}
+
+void Unlock()
+{
+ xSemaphoreGive(sLoggerLock);
+}
+
+} // namespace PigweedLogger
diff --git a/examples/platform/nxp/PigweedLogger.h b/examples/platform/nxp/PigweedLogger.h
new file mode 100644
index 00000000000000..8ea1da5dbae92b
--- /dev/null
+++ b/examples/platform/nxp/PigweedLogger.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2023 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include
+
+namespace PigweedLogger {
+
+void Init(void);
+int PutString(const char * buffer, size_t size);
+
+void Lock();
+void Unlock();
+
+} // namespace PigweedLogger
diff --git a/examples/platform/nxp/Rpc.cpp b/examples/platform/nxp/Rpc.cpp
new file mode 100644
index 00000000000000..d9bf744382627c
--- /dev/null
+++ b/examples/platform/nxp/Rpc.cpp
@@ -0,0 +1,144 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#include "AppTask.h"
+#include "FreeRTOS.h"
+#include "PigweedLogger.h"
+#include "PigweedLoggerMutex.h"
+#include "pigweed/RpcService.h"
+#include "task.h"
+
+#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+#include "pigweed/rpc_services/Attributes.h"
+#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+
+#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+#include "pigweed/rpc_services/Button.h"
+#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+
+#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+#include "pigweed/rpc_services/Device.h"
+#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+
+#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+#include "pigweed/rpc_services/Lighting.h"
+#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+
+#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+#include "pigweed/rpc_services/Locking.h"
+#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+
+#define RPC_TASK_STACK_SIZE 2048
+#define RPC_TASK_PRIORITY 1
+TaskHandle_t RpcTaskHandle;
+
+namespace chip {
+namespace rpc {
+
+#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+class NxpButton final : public Button
+{
+public:
+ pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
+ {
+ GetAppTask().ButtonEventHandler(request.idx, request.idx);
+ return pw::OkStatus();
+ }
+};
+#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+
+#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+class NxpDevice final : public Device
+{
+public:
+ pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
+ {
+ mRebootTimer = xTimerCreate("Reboot", kRebootTimerPeriodTicks, false, nullptr, RebootHandler);
+ xTimerStart(mRebootTimer, pdMS_TO_TICKS(0));
+ return pw::OkStatus();
+ }
+
+private:
+ static constexpr TickType_t kRebootTimerPeriodTicks = 300;
+ TimerHandle_t mRebootTimer;
+
+ static void RebootHandler(TimerHandle_t) { NVIC_SystemReset(); }
+};
+#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+
+namespace {
+
+#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+Attributes attributes_service;
+#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+
+#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+NxpButton button_service;
+#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+
+#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+NxpDevice device_service;
+#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+
+#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+Lighting lighting_service;
+#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+
+#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+Locking locking;
+#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+
+void RegisterServices(pw::rpc::Server & server)
+{
+#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+ server.RegisterService(attributes_service);
+#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE
+
+#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+ server.RegisterService(button_service);
+#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE
+
+#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+ server.RegisterService(device_service);
+#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE
+
+#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+ server.RegisterService(lighting_service);
+#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE
+
+#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+ server.RegisterService(locking);
+#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE
+}
+
+} // namespace
+
+void RunRpcService(void *)
+{
+ Start(RegisterServices, &logger_mutex);
+}
+
+void Init()
+{
+ PigweedLogger::Init();
+
+ xTaskCreate(RunRpcService, "RPC_TASK", RPC_TASK_STACK_SIZE, nullptr, RPC_TASK_PRIORITY, &RpcTaskHandle);
+}
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/platform/nxp/Rpc.h b/examples/platform/nxp/Rpc.h
new file mode 100644
index 00000000000000..741fe7982883cc
--- /dev/null
+++ b/examples/platform/nxp/Rpc.h
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+namespace chip {
+namespace rpc {
+
+class LightingService;
+
+void Init();
+void RunRpcService(void *);
+
+} // namespace rpc
+} // namespace chip
diff --git a/examples/platform/nxp/k32w/k32w0/scripts/sign-outdir.py b/examples/platform/nxp/k32w/k32w0/scripts/sign-outdir.py
index dfaf912ae5283d..ea4a888c9e3555 100644
--- a/examples/platform/nxp/k32w/k32w0/scripts/sign-outdir.py
+++ b/examples/platform/nxp/k32w/k32w0/scripts/sign-outdir.py
@@ -4,7 +4,7 @@
def main(args):
- if os.environ["NXP_K32W0_SDK_ROOT"] != "":
+ if "NXP_K32W0_SDK_ROOT" in os.environ and os.environ["NXP_K32W0_SDK_ROOT"] != "":
sign_images_path = os.environ["NXP_K32W0_SDK_ROOT"] + "/tools/imagetool/sign_images.sh"
else:
sign_images_path = os.getcwd() + "/../../../../../../../third_party/nxp/k32w0_sdk/repo/core/tools/imagetool/sign_images.sh"
diff --git a/examples/platform/nxp/k32w/k32w1/BUILD.gn b/examples/platform/nxp/k32w/k32w1/BUILD.gn
index 0a980406bce075..5cd2a8b31392c2 100644
--- a/examples/platform/nxp/k32w/k32w1/BUILD.gn
+++ b/examples/platform/nxp/k32w/k32w1/BUILD.gn
@@ -13,9 +13,11 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w1_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
-import("${k32w1_sdk_build_root}/k32w1_sdk.gni")
+import("${nxp_sdk_build_root}/nxp_sdk.gni")
+
+import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
config("chip_examples_project_config") {
include_dirs = [
diff --git a/examples/platform/nxp/k32w/k32w1/app/args.gni b/examples/platform/nxp/k32w/k32w1/app/args.gni
index c09510c14df229..2705c251fb807d 100644
--- a/examples/platform/nxp/k32w/k32w1/app/args.gni
+++ b/examples/platform/nxp/k32w/k32w1/app/args.gni
@@ -16,11 +16,6 @@ import("//build_overrides/chip.gni")
import("${chip_root}/src/platform/nxp/k32w/k32w1/args.gni")
-arm_float_abi = "hard"
-arm_cpu = "cortex-m33"
-arm_fpu = "fpv5-sp-d16"
-arm_arch = "armv8-m.main+dsp+fp"
-
openthread_project_core_config_file = "OpenThreadConfig.h"
chip_ble_project_config_include = ""
diff --git a/examples/platform/nxp/k32w/k32w1/app/ldscripts/k32w1_app.ld b/examples/platform/nxp/k32w/k32w1/app/ldscripts/k32w1_app.ld
index de9c882af9fed4..ac8f7bd65d0950 100644
--- a/examples/platform/nxp/k32w/k32w1/app/ldscripts/k32w1_app.ld
+++ b/examples/platform/nxp/k32w/k32w1/app/ldscripts/k32w1_app.ld
@@ -14,7 +14,7 @@
** limitations under the License.
*/
-m_smu2_data_start = 0x489C0000;
+m_smu2_data_start = 0x489C0080;
m_smu2_data_end = 0x489C537B;
m_smu2_data_size = m_smu2_data_end - m_smu2_data_start + 1;
diff --git a/examples/platform/nxp/k32w/k32w1/app/support/BUILD.gn b/examples/platform/nxp/k32w/k32w1/app/support/BUILD.gn
index dafa6de4d3d31d..dc688edc2c78ed 100644
--- a/examples/platform/nxp/k32w/k32w1/app/support/BUILD.gn
+++ b/examples/platform/nxp/k32w/k32w1/app/support/BUILD.gn
@@ -13,7 +13,7 @@
# limitations under the License.
import("//build_overrides/chip.gni")
-import("//build_overrides/k32w1_sdk.gni")
+import("//build_overrides/nxp_sdk.gni")
config("support_config") {
include_dirs = [ "../../../../.." ]
diff --git a/examples/platform/nxp/k32w/k32w1/app/support/FreeRtosHooks.c b/examples/platform/nxp/k32w/k32w1/app/support/FreeRtosHooks.c
index 83549b1dc1f04a..a7c78a77440e03 100644
--- a/examples/platform/nxp/k32w/k32w1/app/support/FreeRtosHooks.c
+++ b/examples/platform/nxp/k32w/k32w1/app/support/FreeRtosHooks.c
@@ -51,10 +51,6 @@
#define APP_DBG_LOG(...)
#endif
-#if (configUSE_TICKLESS_IDLE != 0)
-extern uint64_t PWR_TryEnterLowPower(uint64_t timeoutUs);
-#endif
-
static inline void mutex_init(mbedtls_threading_mutex_t * p_mutex)
{
assert(p_mutex != NULL);
@@ -123,7 +119,7 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
if (abortIdle == false)
{
/* Enter low power with a maximal timeout */
- actualIdleTimeUs = PWR_TryEnterLowPower(expectedIdleTimeUs);
+ actualIdleTimeUs = PWR_EnterLowPower(expectedIdleTimeUs);
/* Re enable systicks and compensate systick timebase */
PWR_SysticksPostProcess(expectedIdleTimeUs, actualIdleTimeUs);
diff --git a/examples/platform/nxp/k32w/k32w1/app/support/Memconfig.cpp b/examples/platform/nxp/k32w/k32w1/app/support/Memconfig.cpp
index e5acf5ea3ceecb..e05281fdee4f4d 100644
--- a/examples/platform/nxp/k32w/k32w1/app/support/Memconfig.cpp
+++ b/examples/platform/nxp/k32w/k32w1/app/support/Memconfig.cpp
@@ -40,6 +40,8 @@
#include
#endif // CHIP_CONFIG_MEMORY_DEBUG_DMALLOC
+#include "fsl_component_mem_manager.h"
+
/* Assumes 8bit bytes! */
#define heapBITS_PER_BYTE ((size_t) 8)
@@ -64,42 +66,6 @@ static size_t xBlockAllocatedBit = ((size_t) 1) << ((sizeof(size_t) * heapBITS_P
extern "C" {
-/* xPortMallocUsableSize relies on heap4 implementation.
-It returns the size of an allocated block and it is
-called by __wrap_realloc.
-Thus it is validated in __wrap_realloc function that the allocated size
-of the old_ptr is smaller than the allocated size of new_ptr */
-size_t xPortMallocUsableSize(void * pv)
-{
- uint8_t * puc = (uint8_t *) pv;
- BlockLink_t * pxLink;
- void * voidp;
- size_t sz = 0;
-
- if (pv != NULL)
- {
- vTaskSuspendAll();
- {
- /* The memory being checked will have an BlockLink_t structure immediately
- before it. */
- puc -= xHeapStructSize;
-
- /* This casting is to keep the compiler from issuing warnings. */
- voidp = (void *) puc;
- pxLink = (BlockLink_t *) voidp;
-
- /* Check if the block is actually allocated. */
- configASSERT((pxLink->xBlockSize & xBlockAllocatedBit) != 0);
- configASSERT(pxLink->pxNextFreeBlock == NULL);
-
- sz = (pxLink->xBlockSize & ~xBlockAllocatedBit) - xHeapStructSize;
- }
- (void) xTaskResumeAll();
- }
-
- return sz;
-}
-
void * __wrap_malloc(size_t size)
{
return pvPortMalloc(size);
@@ -135,34 +101,22 @@ void * __wrap_calloc(size_t num, size_t size)
void * __wrap_realloc(void * ptr, size_t new_size)
{
-
void * new_ptr = NULL;
if (new_size)
{
- size_t old_ptr_size = xPortMallocUsableSize(ptr);
- if (new_size <= old_ptr_size)
- {
- /* Return old pointer if the newly allocated size is smaller
- or equal to the allocated size for old_ptr */
- return ptr;
- }
-
- /* if old_ptr is NULL, then old_ptr_size is zero and new_ptr will be returned */
- new_ptr = pvPortMalloc(new_size);
+ /* MML will only realloc a new pointer if the size is greater than old pointer size.*/
+ vTaskSuspendAll();
+ new_ptr = MEM_BufferRealloc(ptr, new_size);
+ xTaskResumeAll();
if (!new_ptr)
{
ChipLogError(DeviceLayer, "__wrap_realloc: Could not allocate memory!");
return NULL;
}
-
- memset(reinterpret_cast(new_ptr) + old_ptr_size, 0, (new_size - old_ptr_size));
- memcpy(new_ptr, ptr, old_ptr_size);
}
- vPortFree(ptr);
-
return new_ptr;
}
diff --git a/examples/platform/nxp/pw_rpc_server.gni b/examples/platform/nxp/pw_rpc_server.gni
new file mode 100644
index 00000000000000..0ec2d3b121b2d5
--- /dev/null
+++ b/examples/platform/nxp/pw_rpc_server.gni
@@ -0,0 +1,62 @@
+# 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.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/target_types.gni")
+import("${chip_root}/src/platform/device.gni")
+
+nxp_platform_dir = "${chip_root}/examples/platform/nxp"
+
+# Define a scope for pw RPC server dependencies.
+# This .gni file should be imported by applications that want to use pw RPC.
+# These variables shall be copied in the final executable target by adding
+# forward_variables_from(pw_rpc_server, "*") in the beginning of the target scope.
+pw_rpc_server = {
+ sources = [
+ "${chip_root}/examples/common/pigweed/RpcService.cpp",
+ "${chip_root}/examples/common/pigweed/nxp/PigweedLoggerMutex.cpp",
+ "${nxp_platform_dir}/PigweedLogger.cpp",
+ "${nxp_platform_dir}/Rpc.cpp",
+ ]
+
+ include_dirs = [
+ "${chip_root}/examples/common",
+ "${chip_root}/examples/common/pigweed",
+ "${chip_root}/examples/common/pigweed/nxp",
+ "${nxp_platform_dir}",
+ ]
+
+ defines = [
+ "PW_RPC_ENABLED",
+ "PW_RPC_ATTRIBUTE_SERVICE=1",
+ "PW_RPC_BUTTON_SERVICE=1",
+ "PW_RPC_DEVICE_SERVICE=1",
+ "PW_RPC_LIGHTING_SERVICE=1",
+ ]
+
+ deps = [
+ "$dir_pw_hdlc:rpc_channel_output",
+ "$dir_pw_stream:sys_io_stream",
+ "$dir_pw_trace",
+ "${chip_root}/config/nxp/lib/pw_rpc:pw_rpc",
+ "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc",
+ "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc",
+ "${nxp_platform_dir}/pw_sys_io:pw_sys_io_nxp",
+ ]
+ deps += pw_build_LINK_DEPS
+}
diff --git a/examples/platform/nxp/pw_sys_io/BUILD.gn b/examples/platform/nxp/pw_sys_io/BUILD.gn
new file mode 100644
index 00000000000000..ed3d35246093f1
--- /dev/null
+++ b/examples/platform/nxp/pw_sys_io/BUILD.gn
@@ -0,0 +1,42 @@
+# 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.
+
+import("//build_overrides/chip.gni")
+import("//build_overrides/nxp_sdk.gni")
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/target_types.gni")
+import("${chip_root}/src/platform/device.gni")
+
+config("default_config") {
+ include_dirs = [
+ "public",
+ "${chip_root}/src/",
+ ]
+}
+
+pw_source_set("pw_sys_io_nxp") {
+ sources = [
+ "${chip_root}/src/lib/shell/streamer_nxp.cpp",
+ "sys_io_nxp.cc",
+ ]
+
+ deps = [
+ "$dir_pw_sys_io:default_putget_bytes",
+ "$dir_pw_sys_io:facade",
+ "${nxp_sdk_build_root}/${nxp_sdk_name}:nxp_sdk",
+ ]
+
+ public_configs = [ ":default_config" ]
+}
diff --git a/examples/platform/nxp/pw_sys_io/public/pw_sys_io_nxp/init.h b/examples/platform/nxp/pw_sys_io/public/pw_sys_io_nxp/init.h
new file mode 100644
index 00000000000000..47d18772638d5f
--- /dev/null
+++ b/examples/platform/nxp/pw_sys_io/public/pw_sys_io_nxp/init.h
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "pw_preprocessor/util.h"
+
+PW_EXTERN_C_START
+
+// The actual implement of PreMainInit() in sys_io_BACKEND.
+void pw_sys_io_Init();
+
+PW_EXTERN_C_END
diff --git a/examples/platform/nxp/pw_sys_io/sys_io_nxp.cc b/examples/platform/nxp/pw_sys_io/sys_io_nxp.cc
new file mode 100644
index 00000000000000..8e729f0986bbb3
--- /dev/null
+++ b/examples/platform/nxp/pw_sys_io/sys_io_nxp.cc
@@ -0,0 +1,78 @@
+/*
+ *
+ * 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.
+ */
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+
+int16_t console_getchar(char * chr)
+{
+ auto * streamer = chip::Shell::streamer_get();
+ return static_cast(streamer->read_cb(nullptr, chr, 1));
+}
+
+int16_t console_putchar(const char * chr)
+{
+ auto * streamer = chip::Shell::streamer_get();
+ return static_cast(streamer->write_cb(nullptr, chr, 1));
+}
+
+extern "C" void pw_sys_io_Init()
+{
+ auto * streamer = chip::Shell::streamer_get();
+ streamer->init_cb(nullptr);
+}
+
+namespace pw::sys_io {
+
+Status ReadByte(std::byte * dest)
+{
+ if (!dest)
+ return Status::InvalidArgument();
+
+ int16_t ret = console_getchar(reinterpret_cast(dest));
+ return ret < 0 ? Status::FailedPrecondition() : OkStatus();
+}
+
+Status WriteByte(std::byte b)
+{
+ int16_t ret = console_putchar(reinterpret_cast(&b));
+ return ret < 0 ? Status::FailedPrecondition() : OkStatus();
+}
+
+// Writes a string using pw::sys_io, and add newline characters at the end.
+StatusWithSize WriteLine(const std::string_view & s)
+{
+ size_t chars_written = 0;
+ StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
+ if (!result.ok())
+ {
+ return result;
+ }
+ chars_written += result.size();
+ result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
+ chars_written += result.size();
+
+ return StatusWithSize(result.status(), chars_written);
+}
+
+} // namespace pw::sys_io
diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn
index 99be69fbbc9b14..bbfeee1fa679e1 100644
--- a/examples/platform/silabs/SiWx917/BUILD.gn
+++ b/examples/platform/silabs/SiWx917/BUILD.gn
@@ -32,7 +32,7 @@ declare_args() {
sl_wfx_config_scan = true
# Argument to force enable WPA3 security on rs91x
- rs91x_wpa3_transition = false
+ rs91x_wpa3_transition = true
# use commissionable data for SiWx917
siwx917_commissionable_data = false
diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn
index effbe038389f06..02f1317f55b643 100644
--- a/examples/platform/silabs/efr32/BUILD.gn
+++ b/examples/platform/silabs/efr32/BUILD.gn
@@ -32,7 +32,7 @@ declare_args() {
sl_wfx_config_scan = true
# Argument to force enable WPA3 security on rs91x
- rs91x_wpa3_transition = false
+ rs91x_wpa3_transition = true
#default WiFi SSID
chip_default_wifi_ssid = ""
diff --git a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
index 4c670552dc2baf..02e87a04f067f0 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
@@ -54,7 +54,7 @@ ti_sysconfig("sysconfig") {
]
}
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 31f0846c412008..8ac373b643bfce 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -459,15 +459,15 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
void AppTask::InitOnOffClusterState()
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
ChipLogProgress(NotSpecified, "Init On/Off clusterstate");
// Write false as pump always boots in stopped mode
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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));
}
}
@@ -482,7 +482,7 @@ void AppTask::UpdateClusterState(void)
void AppTask::UpdateCluster(intptr_t context)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
BitMask pumpStatus;
ChipLogProgress(NotSpecified, "Update Cluster State");
@@ -501,126 +501,126 @@ void AppTask::UpdateCluster(intptr_t context)
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(PCC_CLUSTER_ENDPOINT,
PumpConfigurationAndControl::ControlModeEnum::kConstantFlow);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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
bool onOffState = !PumpMgr().IsStopped();
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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/BUILD.gn b/examples/pump-app/cc13x4_26x4/BUILD.gn
index 7cbf21cc41140e..8c68ba70066315 100644
--- a/examples/pump-app/cc13x4_26x4/BUILD.gn
+++ b/examples/pump-app/cc13x4_26x4/BUILD.gn
@@ -62,7 +62,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
index c98e99be1cb487..ea094e96767665 100644
--- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
+++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
@@ -456,15 +456,15 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
void AppTask::InitOnOffClusterState()
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
ChipLogProgress(NotSpecified, "Init On/Off clusterstate");
// Write false as pump always boots in stopped mode
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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));
}
}
@@ -479,7 +479,7 @@ void AppTask::UpdateClusterState(void)
void AppTask::UpdateCluster(intptr_t context)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
BitMask pumpStatus;
ChipLogProgress(NotSpecified, "Update Cluster State");
@@ -498,126 +498,126 @@ void AppTask::UpdateCluster(intptr_t context)
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(PCC_CLUSTER_ENDPOINT,
PumpConfigurationAndControl::ControlModeEnum::kConstantFlow);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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
bool onOffState = !PumpMgr().IsStopped();
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 1426977d5028ec..3a6eb9023ded0a 100644
--- a/examples/pump-app/nrfconnect/main/AppTask.cpp
+++ b/examples/pump-app/nrfconnect/main/AppTask.cpp
@@ -562,7 +562,7 @@ void AppTask::DispatchEvent(const AppEvent & event)
void AppTask::UpdateClusterState()
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
ChipLogProgress(NotSpecified, "UpdateClusterState");
@@ -571,99 +571,99 @@ void AppTask::UpdateClusterState()
bool onOffState = !PumpMgr().IsStopped();
status = OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 != EMBER_ZCL_STATUS_SUCCESS)
+ 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 5b46641cd58dbc..365c53fc7a33ac 100644
--- a/examples/pump-app/silabs/src/AppTask.cpp
+++ b/examples/pump-app/silabs/src/AppTask.cpp
@@ -242,11 +242,11 @@ void AppTask::ActionCompleted(PumpManager::Action_t aAction, int32_t aActor)
void AppTask::UpdateClusterState(intptr_t context)
{
// Set On/Off state
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
bool onOffState = !PumpMgr().IsStopped();
status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(PCC_CLUSTER_ENDPOINT, onOffState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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 4b443464879146..368702d51ae11f 100644
--- a/examples/pump-app/telink/src/AppTask.cpp
+++ b/examples/pump-app/telink/src/AppTask.cpp
@@ -131,10 +131,10 @@ void AppTask::UpdateClusterState()
// Write the new values
bool onOffState = !PumpMgr().IsStopped();
- EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
index fb118046b876c4..2d66a7f993158b 100644
--- a/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
@@ -55,7 +55,7 @@ ti_sysconfig("sysconfig") {
]
}
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn
index c1b106f0feb1c2..289b10de001294 100644
--- a/examples/pump-controller-app/cc13x4_26x4/BUILD.gn
+++ b/examples/pump-controller-app/cc13x4_26x4/BUILD.gn
@@ -63,7 +63,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
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/shell/cc13x2x7_26x2x7/BUILD.gn b/examples/shell/cc13x2x7_26x2x7/BUILD.gn
index 5264bd079c02b0..80e342313aaca6 100644
--- a/examples/shell/cc13x2x7_26x2x7/BUILD.gn
+++ b/examples/shell/cc13x2x7_26x2x7/BUILD.gn
@@ -59,7 +59,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x2x7_26x2x7_dmm_config" ]
cflags = [
"-Wno-comment",
diff --git a/examples/shell/cc13x4_26x4/BUILD.gn b/examples/shell/cc13x4_26x4/BUILD.gn
index e6db696baa649c..2480f085783384 100644
--- a/examples/shell/cc13x4_26x4/BUILD.gn
+++ b/examples/shell/cc13x4_26x4/BUILD.gn
@@ -59,7 +59,7 @@ ti_sysconfig("sysconfig") {
#"ti_build_config.opt",
]
- public_configs = [ ":sdk_dmm_config" ]
+ public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
cflags = [
"-Wno-comment",
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/ThermostaticRadiatorValveManager.cpp b/examples/thermostat/qpg/src/ThermostaticRadiatorValveManager.cpp
index f8f2c348cc2558..55173272977964 100644
--- a/examples/thermostat/qpg/src/ThermostaticRadiatorValveManager.cpp
+++ b/examples/thermostat/qpg/src/ThermostaticRadiatorValveManager.cpp
@@ -304,7 +304,7 @@ void ThermostaticRadiatorValveManager::UpdateLocalTemperature(int16_t aLocalTemp
{
SystemLayer().ScheduleLambda([aLocalTemperature] {
ChipLogProgress(NotSpecified, "UpdateLocalTemperature with value (0.01 degC) %u", aLocalTemperature);
- if (EMBER_ZCL_STATUS_SUCCESS !=
+ if (Protocols::InteractionModel::Status::Success !=
Thermostat::Attributes::LocalTemperature::Set(QPG_THERMOSTATIC_ENDPOINT_ID, aLocalTemperature))
{
ChipLogProgress(NotSpecified, "UpdateLocalTemperature failure");
diff --git a/examples/thermostat/qpg/src/ZclCallbacks.cpp b/examples/thermostat/qpg/src/ZclCallbacks.cpp
index 4551a0d0bedb2f..c66901656442cc 100644
--- a/examples/thermostat/qpg/src/ZclCallbacks.cpp
+++ b/examples/thermostat/qpg/src/ZclCallbacks.cpp
@@ -56,10 +56,10 @@ void emberAfThermostatClusterInitCallback(EndpointId endpoint)
{
// Temp. code for testing purpose, need to be updated
- const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) {
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
index 2151dd63920f74..b3160b2ec2fd8b 100644
--- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
+++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
@@ -112,7 +112,8 @@ uint16_t AccountLoginManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "AccountLoginManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
index 31745a93c42fce..86eabb83f99066 100644
--- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
+++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
@@ -174,7 +174,8 @@ uint16_t AppContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "AppContentLauncherManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
index 39e364d60e4148..087f1742c355a0 100644
--- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
+++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
@@ -292,7 +292,8 @@ uint16_t AppMediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "AppMediaPlaybackManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
index cb22e9fd9b8abf..23cf8058bab068 100644
--- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
@@ -154,7 +154,8 @@ uint16_t TargetNavigatorManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "TargetNavigatorManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp
index 997f041b78982f..3c0efcab9f8cdc 100644
--- a/examples/tv-app/android/java/ChannelManager.cpp
+++ b/examples/tv-app/android/java/ChannelManager.cpp
@@ -761,7 +761,8 @@ uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "ChannelManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
index 53136c23e5a596..3963140d1b5e65 100644
--- a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
+++ b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
@@ -41,7 +41,7 @@ using LaunchResponseType = chip::app::Clusters::ContentLauncher::Command
using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type;
using NavigateTargetResponseType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type;
using GetSetupPINResponseType = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type;
-using Status = Protocols::InteractionModel::Status;
+using Status = chip::Protocols::InteractionModel::Status;
const std::string FAILURE_KEY = "PlatformError";
const std::string FAILURE_STATUS_KEY = "Status";
@@ -60,7 +60,7 @@ void ContentAppCommandDelegate::InvokeCommand(CommandHandlerInterface::HandlerCo
{
handlerContext.SetCommandHandled();
handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath,
- Protocols::InteractionModel::Status::InvalidCommand);
+ chip::Protocols::InteractionModel::Status::InvalidCommand);
return;
}
@@ -112,7 +112,7 @@ Status ContentAppCommandDelegate::InvokeCommand(EndpointId epId, ClusterId clust
if (!mContentAppEndpointManager.HasValidObjectRef())
{
- return Protocols::InteractionModel::Status::Failure;
+ return chip::Protocols::InteractionModel::Status::Failure;
}
jstring resp =
@@ -133,7 +133,7 @@ Status ContentAppCommandDelegate::InvokeCommand(EndpointId epId, ClusterId clust
if (!reader.parse(respStr.c_str(), value))
{
env->DeleteLocalRef(resp);
- return Protocols::InteractionModel::Status::Failure;
+ return chip::Protocols::InteractionModel::Status::Failure;
}
}
env->DeleteLocalRef(resp);
@@ -146,15 +146,15 @@ Status ContentAppCommandDelegate::InvokeCommand(EndpointId epId, ClusterId clust
{
return static_cast(value[FAILURE_STATUS_KEY].asUInt());
}
- return Protocols::InteractionModel::Status::Failure;
+ return chip::Protocols::InteractionModel::Status::Failure;
}
- return Protocols::InteractionModel::Status::UnsupportedEndpoint;
+ return chip::Protocols::InteractionModel::Status::UnsupportedEndpoint;
}
else
{
commandHandled = false;
- return Protocols::InteractionModel::Status::UnsupportedEndpoint;
+ return chip::Protocols::InteractionModel::Status::UnsupportedEndpoint;
}
}
@@ -178,7 +178,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
handlerContext.mRequestPath, static_cast(value[FAILURE_STATUS_KEY].asUInt()));
return;
}
- handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, Protocols::InteractionModel::Status::Failure);
+ handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, chip::Protocols::InteractionModel::Status::Failure);
return;
}
@@ -187,7 +187,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
case app::Clusters::ContentLauncher::Id: {
Status status;
LaunchResponseType launchResponse = FormatContentLauncherResponse(value, status);
- if (status != Protocols::InteractionModel::Status::Success)
+ if (status != chip::Protocols::InteractionModel::Status::Success)
{
handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, status);
}
@@ -201,7 +201,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
case app::Clusters::TargetNavigator::Id: {
Status status;
NavigateTargetResponseType navigateTargetResponse = FormatNavigateTargetResponse(value, status);
- if (status != Protocols::InteractionModel::Status::Success)
+ if (status != chip::Protocols::InteractionModel::Status::Success)
{
handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, status);
}
@@ -215,7 +215,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
case app::Clusters::MediaPlayback::Id: {
Status status;
PlaybackResponseType playbackResponse = FormatMediaPlaybackResponse(value, status);
- if (status != Protocols::InteractionModel::Status::Success)
+ if (status != chip::Protocols::InteractionModel::Status::Success)
{
handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, status);
}
@@ -234,7 +234,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
}
Status status;
GetSetupPINResponseType getSetupPINresponse = FormatGetSetupPINResponse(value, status);
- if (status != Protocols::InteractionModel::Status::Success)
+ if (status != chip::Protocols::InteractionModel::Status::Success)
{
handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, status);
}
@@ -251,13 +251,13 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
LaunchResponseType ContentAppCommandDelegate::FormatContentLauncherResponse(Json::Value value, Status & status)
{
- status = Protocols::InteractionModel::Status::Success;
+ status = chip::Protocols::InteractionModel::Status::Success;
LaunchResponseType launchResponse;
std::string statusFieldId =
std::to_string(to_underlying(app::Clusters::ContentLauncher::Commands::LauncherResponse::Fields::kStatus));
if (value[statusFieldId].empty())
{
- status = Protocols::InteractionModel::Status::Failure;
+ status = chip::Protocols::InteractionModel::Status::Failure;
return launchResponse;
}
else
@@ -275,13 +275,13 @@ LaunchResponseType ContentAppCommandDelegate::FormatContentLauncherResponse(Json
NavigateTargetResponseType ContentAppCommandDelegate::FormatNavigateTargetResponse(Json::Value value, Status & status)
{
- status = Protocols::InteractionModel::Status::Success;
+ status = chip::Protocols::InteractionModel::Status::Success;
NavigateTargetResponseType navigateTargetResponse;
std::string statusFieldId =
std::to_string(to_underlying(app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Fields::kStatus));
if (value[statusFieldId].empty())
{
- status = Protocols::InteractionModel::Status::Failure;
+ status = chip::Protocols::InteractionModel::Status::Failure;
return navigateTargetResponse;
}
else
@@ -299,13 +299,13 @@ NavigateTargetResponseType ContentAppCommandDelegate::FormatNavigateTargetRespon
PlaybackResponseType ContentAppCommandDelegate::FormatMediaPlaybackResponse(Json::Value value, Status & status)
{
- status = Protocols::InteractionModel::Status::Success;
+ status = chip::Protocols::InteractionModel::Status::Success;
PlaybackResponseType playbackResponse;
std::string statusFieldId =
std::to_string(to_underlying(app::Clusters::MediaPlayback::Commands::PlaybackResponse::Fields::kStatus));
if (value[statusFieldId].empty())
{
- status = Protocols::InteractionModel::Status::Failure;
+ status = chip::Protocols::InteractionModel::Status::Failure;
return playbackResponse;
}
else
@@ -323,7 +323,7 @@ PlaybackResponseType ContentAppCommandDelegate::FormatMediaPlaybackResponse(Json
GetSetupPINResponseType ContentAppCommandDelegate::FormatGetSetupPINResponse(Json::Value value, Status & status)
{
- status = Protocols::InteractionModel::Status::Success;
+ status = chip::Protocols::InteractionModel::Status::Success;
GetSetupPINResponseType getSetupPINresponse;
std::string setupPINFieldId =
std::to_string(to_underlying(app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Fields::kSetupPIN));
diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.h b/examples/tv-app/android/java/ContentAppCommandDelegate.h
index a896e55b4ce035..750aff6d34853c 100644
--- a/examples/tv-app/android/java/ContentAppCommandDelegate.h
+++ b/examples/tv-app/android/java/ContentAppCommandDelegate.h
@@ -34,7 +34,7 @@ namespace chip {
namespace AppPlatform {
using CommandHandlerInterface = chip::app::CommandHandlerInterface;
-using Status = Protocols::InteractionModel::Status;
+using Status = chip::Protocols::InteractionModel::Status;
using LaunchResponseType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Type;
using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type;
using NavigateTargetResponseType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type;
diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp
index 25e5659b4f6703..caa14b04f9e938 100644
--- a/examples/tv-app/android/java/ContentLauncherManager.cpp
+++ b/examples/tv-app/android/java/ContentLauncherManager.cpp
@@ -295,7 +295,8 @@ uint16_t ContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "ContentLauncherManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/java/LevelManager.cpp b/examples/tv-app/android/java/LevelManager.cpp
index f8e3dab6aa7773..b79f150c7ae20e 100644
--- a/examples/tv-app/android/java/LevelManager.cpp
+++ b/examples/tv-app/android/java/LevelManager.cpp
@@ -83,9 +83,9 @@ void LevelManager::PostLevelChanged(chip::EndpointId endpoint, uint8_t value)
jboolean LevelManager::SetLevel(jint endpoint, jint value)
{
- EmberAfStatus status = app::Clusters::LevelControl::Attributes::CurrentLevel::Set(static_cast(endpoint),
- static_cast(value));
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ chip::Protocols::InteractionModel::Status status = app::Clusters::LevelControl::Attributes::CurrentLevel::Set(
+ static_cast(endpoint), static_cast(value));
+ return status == chip::Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR LevelManager::InitializeWithObjects(jobject managerObject)
diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp
index 8da71d5a533193..62abeb12ec30eb 100644
--- a/examples/tv-app/android/java/MediaPlaybackManager.cpp
+++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp
@@ -614,7 +614,8 @@ uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "MediaPlaybackManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/android/java/OnOffManager.cpp b/examples/tv-app/android/java/OnOffManager.cpp
index c05c20700eabd0..9a330754aa4a16 100644
--- a/examples/tv-app/android/java/OnOffManager.cpp
+++ b/examples/tv-app/android/java/OnOffManager.cpp
@@ -84,8 +84,9 @@ void OnOffManager::PostOnOffChanged(chip::EndpointId endpoint, bool value)
jboolean OnOffManager::SetOnOff(jint endpoint, bool value)
{
chip::DeviceLayer::StackLock stack;
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(static_cast(endpoint), value);
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ chip::Protocols::InteractionModel::Status status =
+ app::Clusters::OnOff::Attributes::OnOff::Set(static_cast(endpoint), value);
+ return status == chip::Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR OnOffManager::InitializeWithObjects(jobject managerObject)
diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
index 532986f7ba4eea..0f3e5b5036e081 100644
--- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
+++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
@@ -74,7 +74,8 @@ uint16_t AccountLoginManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "AccountLoginManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
index 82a278b827cd6a..75bb07b5438dd1 100644
--- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
+++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
@@ -347,7 +347,8 @@ uint16_t ChannelManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "ChannelManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
index 572209a44d11c3..b062c64b95efd6 100644
--- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
+++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
@@ -214,7 +214,8 @@ uint16_t ContentLauncherManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "ContentLauncherManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
index f97a2e98630e01..456aba87b61b3a 100644
--- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
+++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
@@ -335,7 +335,8 @@ uint16_t MediaPlaybackManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "MediaPlaybackManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
index 0d3a15578b861d..9b907339df02e4 100644
--- a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
@@ -76,7 +76,8 @@ uint16_t TargetNavigatorManager::GetClusterRevision(chip::EndpointId endpoint)
}
uint16_t clusterRevision = 0;
- bool success = (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success =
+ (Attributes::ClusterRevision::Get(endpoint, &clusterRevision) == chip::Protocols::InteractionModel::Status::Success);
if (!success)
{
ChipLogError(Zcl, "TargetNavigatorManager::GetClusterRevision error reading cluster revision");
diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter
index e4099412be31c5..6effacc92c0812 100644
--- a/examples/tv-app/tv-common/tv-app.matter
+++ b/examples/tv-app/tv-common/tv-app.matter
@@ -2024,7 +2024,7 @@ cluster UserLabel = 65 {
}
/** This cluster provides an interface for passing messages to be presented by a device. */
-cluster Messages = 151 {
+provisional cluster Messages = 151 {
revision 3;
enum FutureMessagePreferenceEnum : enum8 {
@@ -3053,7 +3053,7 @@ cluster AccountLogin = 1294 {
}
/** This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. */
-cluster ContentControl = 1295 {
+provisional cluster ContentControl = 1295 {
revision 1; // NOTE: Default/not specifically set
bitmap Feature : bitmap32 {
@@ -3136,7 +3136,7 @@ cluster ContentControl = 1295 {
}
/** This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. */
-cluster ContentAppObserver = 1296 {
+provisional cluster ContentAppObserver = 1296 {
revision 1; // NOTE: Default/not specifically set
enum StatusEnum : enum8 {
diff --git a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp
index e4bb7647085b40..98f6b197a59e33 100644
--- a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp
+++ b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp
@@ -278,7 +278,7 @@ void CastingServer::ReadServerClustersForNode(NodeId nodeId)
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && nodeId == binding.nodeId)
+ if (binding.type == MATTER_UNICAST_BINDING && nodeId == binding.nodeId)
{
if (!mActiveTargetVideoPlayerInfo.HasEndpoint(binding.remote))
{
@@ -550,7 +550,7 @@ void CastingServer::DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * eve
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
+ if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
{
ChipLogProgress(
NotSpecified,
@@ -641,7 +641,7 @@ NodeId CastingServer::GetVideoPlayerNodeForFabricIndex(FabricIndex fabricIndex)
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && fabricIndex == binding.fabricIndex)
+ if (binding.type == MATTER_UNICAST_BINDING && fabricIndex == binding.fabricIndex)
{
ChipLogProgress(NotSpecified, "GetVideoPlayerNodeForFabricIndex nodeId=0x" ChipLogFormatX64,
ChipLogValueX64(binding.nodeId));
@@ -667,7 +667,7 @@ FabricIndex CastingServer::GetVideoPlayerFabricIndexForNode(NodeId nodeId)
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && nodeId == binding.nodeId)
+ if (binding.type == MATTER_UNICAST_BINDING && nodeId == binding.nodeId)
{
ChipLogProgress(NotSpecified, "GetVideoPlayerFabricIndexForNode fabricIndex=%d nodeId=0x" ChipLogFormatX64,
binding.fabricIndex, ChipLogValueX64(binding.nodeId));
diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp
index bced79be4bc102..20558982ea78ca 100644
--- a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp
+++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp
@@ -156,7 +156,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
+ if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
{
ChipLogProgress(AppServer,
"ChipDeviceEventHandler::HandleBindingsChangedViaCluster Matched accessingFabricIndex with "
diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp
index 478847d15a2eca..60d589c1fc640b 100644
--- a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp
+++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp
@@ -53,7 +53,7 @@ void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeM
for (const auto & binding : chip::BindingTable::GetInstance())
{
- if (binding.type == EMBER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId)
+ if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId)
{
// check to see if we discovered a new endpoint in the bindings
chip::EndpointId endpointId = binding.remote;
@@ -86,7 +86,7 @@ CHIP_ERROR EndpointListLoader::Load()
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
- if (binding.type == EMBER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId)
+ if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId)
{
// if we discovered a new Endpoint from the bindings, read its EndpointAttributes
chip::EndpointId endpointId = binding.remote;
diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
index 7eee24e57ce285..4bece078774075 100644
--- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
+++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
@@ -1502,7 +1502,7 @@ cluster FixedLabel = 64 {
}
/** This cluster provides an interface for passing messages to be presented by a device. */
-cluster Messages = 151 {
+provisional cluster Messages = 151 {
revision 3;
enum FutureMessagePreferenceEnum : enum8 {
@@ -2515,7 +2515,7 @@ cluster AccountLogin = 1294 {
}
/** This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. */
-cluster ContentControl = 1295 {
+provisional cluster ContentControl = 1295 {
revision 1; // NOTE: Default/not specifically set
bitmap Feature : bitmap32 {
@@ -2598,7 +2598,7 @@ cluster ContentControl = 1295 {
}
/** This cluster provides an interface for sending targeted commands to an Observer of a Content App on a Video Player device such as a Streaming Media Player, Smart TV or Smart Screen. The cluster server for Content App Observer is implemented by an endpoint that communicates with a Content App, such as a Casting Video Client. The cluster client for Content App Observer is implemented by a Content App endpoint. A Content App is informed of the NodeId of an Observer when a binding is set on the Content App. The Content App can then send the ContentAppMessage to the Observer (server cluster), and the Observer responds with a ContentAppMessageResponse. */
-cluster ContentAppObserver = 1296 {
+provisional cluster ContentAppObserver = 1296 {
revision 1; // NOTE: Default/not specifically set
enum StatusEnum : enum8 {
diff --git a/examples/virtual-device-app/android/java/DoorLockManager.cpp b/examples/virtual-device-app/android/java/DoorLockManager.cpp
index 5e85ffc817b4c9..b3e245ea75dac2 100644
--- a/examples/virtual-device-app/android/java/DoorLockManager.cpp
+++ b/examples/virtual-device-app/android/java/DoorLockManager.cpp
@@ -49,10 +49,11 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
ChipLogProgress(Zcl, "Device App::DoorLock::PostClusterInit");
DeviceAppJNIMgr().PostClusterInit(chip::app::Clusters::DoorLock::Id, endpoint);
DoorLockServer::Instance().InitServer(endpoint);
- EmberAfStatus status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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));
}
}
@@ -104,9 +105,9 @@ DoorLockManager * GetDoorLockManager(EndpointId endpoint)
jboolean DoorLockManager::SetLockType(jint endpoint, jint value)
{
- EmberAfStatus status = app::Clusters::DoorLock::Attributes::LockType::Set(
+ Protocols::InteractionModel::Status status = app::Clusters::DoorLock::Attributes::LockType::Set(
static_cast(endpoint), static_cast(value));
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ return status == Protocols::InteractionModel::Status::Success;
}
jboolean DoorLockManager::SetLockState(jint endpoint, jint value)
@@ -127,16 +128,16 @@ jboolean DoorLockManager::SetAutoRelockTime(jint endpoint, jint value)
jboolean DoorLockManager::SetOperatingMode(jint endpoint, jint value)
{
- EmberAfStatus status = app::Clusters::DoorLock::Attributes::OperatingMode::Set(
+ Protocols::InteractionModel::Status status = app::Clusters::DoorLock::Attributes::OperatingMode::Set(
static_cast(endpoint), static_cast(value));
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ return status == Protocols::InteractionModel::Status::Success;
}
jboolean DoorLockManager::SetSupportedOperatingModes(jint endpoint, jint value)
{
- EmberAfStatus status = app::Clusters::DoorLock::Attributes::SupportedOperatingModes::Set(
+ Protocols::InteractionModel::Status status = app::Clusters::DoorLock::Attributes::SupportedOperatingModes::Set(
static_cast(endpoint), static_cast(value));
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ return status == Protocols::InteractionModel::Status::Success;
}
jboolean DoorLockManager::SendLockAlarmEvent(jint endpoint)
diff --git a/examples/virtual-device-app/android/java/OnOffManager.cpp b/examples/virtual-device-app/android/java/OnOffManager.cpp
index 2dcede64a8bce5..c058e99a91c111 100644
--- a/examples/virtual-device-app/android/java/OnOffManager.cpp
+++ b/examples/virtual-device-app/android/java/OnOffManager.cpp
@@ -82,8 +82,9 @@ void OnOffManager::PostOnOffChanged(chip::EndpointId endpoint, bool value)
jboolean OnOffManager::SetOnOff(jint endpoint, bool value)
{
- EmberAfStatus status = app::Clusters::OnOff::Attributes::OnOff::Set(static_cast(endpoint), value);
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status status =
+ app::Clusters::OnOff::Attributes::OnOff::Set(static_cast(endpoint), value);
+ return status == Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR OnOffManager::InitializeWithObjects(jobject managerObject)
diff --git a/examples/virtual-device-app/android/java/PowerSourceManager.cpp b/examples/virtual-device-app/android/java/PowerSourceManager.cpp
index afbdcca23bacb7..e71a5bb1eec692 100644
--- a/examples/virtual-device-app/android/java/PowerSourceManager.cpp
+++ b/examples/virtual-device-app/android/java/PowerSourceManager.cpp
@@ -83,13 +83,13 @@ jboolean PowerSourceManager::SetBatPercentRemaining(jint endpoint, jint value)
{
using namespace chip::app::Clusters;
using namespace chip::DeviceLayer;
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Protocols::InteractionModel::Status status = Protocols::InteractionModel::Status::Success;
status =
PowerSource::Attributes::BatPercentRemaining::Set(static_cast(endpoint), static_cast(value * 2));
ChipLogDetail(Zcl, "Device App::PowerSource::SetBatPercentRemaining: endpoint:%d, percent:%d", endpoint, value);
- return status == EMBER_ZCL_STATUS_SUCCESS;
+ return status == Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR PowerSourceManager::InitializeWithObjects(jobject managerObject)
diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp
index 11d49b7e34ed20..aa0e2654a5e4d3 100644
--- a/examples/window-app/common/src/WindowApp.cpp
+++ b/examples/window-app/common/src/WindowApp.cpp
@@ -455,7 +455,7 @@ void WindowApp::Cover::Finish()
void WindowApp::Cover::LiftStepToward(OperationalState direction)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
chip::Percent100ths percent100ths;
NPercent100ths current;
@@ -463,7 +463,7 @@ void WindowApp::Cover::LiftStepToward(OperationalState direction)
status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
percent100ths = ComputePercent100thsStep(direction, current.Value(), LIFT_DELTA);
}
@@ -519,7 +519,7 @@ void WindowApp::Cover::LiftUpdate(bool newTarget)
void WindowApp::Cover::TiltStepToward(OperationalState direction)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
chip::Percent100ths percent100ths;
NPercent100ths current;
@@ -527,7 +527,7 @@ void WindowApp::Cover::TiltStepToward(OperationalState direction)
status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
percent100ths = ComputePercent100thsStep(direction, current.Value(), TILT_DELTA);
}
@@ -595,7 +595,7 @@ void WindowApp::Cover::StepToward(OperationalState direction, bool isTilt)
void WindowApp::Cover::UpdateTargetPosition(OperationalState direction, bool isTilt)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
NPercent100ths current;
chip::Percent100ths target;
@@ -604,7 +604,7 @@ void WindowApp::Cover::UpdateTargetPosition(OperationalState direction, bool isT
if (isTilt)
{
status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current);
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
target = ComputePercent100thsStep(direction, current.Value(), TILT_DELTA);
@@ -614,7 +614,7 @@ void WindowApp::Cover::UpdateTargetPosition(OperationalState direction, bool isT
else
{
status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current);
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
target = ComputePercent100thsStep(direction, current.Value(), LIFT_DELTA);
diff --git a/examples/window-app/nrfconnect/main/WindowCovering.cpp b/examples/window-app/nrfconnect/main/WindowCovering.cpp
index f2d078838a427b..4d200ffa3c919e 100644
--- a/examples/window-app/nrfconnect/main/WindowCovering.cpp
+++ b/examples/window-app/nrfconnect/main/WindowCovering.cpp
@@ -59,8 +59,10 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
NPercent100ths target{};
NPercent100ths positionToSet{};
- VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
- VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
+ Protocols::InteractionModel::Status::Success);
+ VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) ==
+ Protocols::InteractionModel::Status::Success);
OperationalState state = ComputeOperationalState(target, current);
UpdateOperationalStatus(MoveType::LIFT, state);
@@ -85,7 +87,8 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
// assume single move completed
Instance().mInLiftMove = false;
- VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
+ Protocols::InteractionModel::Status::Success);
if (!TargetCompleted(MoveType::LIFT, current, target))
{
@@ -101,7 +104,7 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
{
- EmberAfStatus status{};
+ Protocols::InteractionModel::Status status{};
chip::Percent100ths percent100ths{};
NPercent100ths current{};
OperationalState opState{};
@@ -117,7 +120,7 @@ chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
opState = OperationalStateGet(Endpoint(), OperationalStatus::kTilt);
}
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
static constexpr auto sPercentDelta{ WC_PERCENT100THS_MAX_CLOSED / 20 };
percent100ths = ComputePercent100thsStep(opState, current.Value(), sPercentDelta);
@@ -168,8 +171,10 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
NPercent100ths target{};
NPercent100ths positionToSet{};
- VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
- VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
+ Protocols::InteractionModel::Status::Success);
+ VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) ==
+ Protocols::InteractionModel::Status::Success);
OperationalState state = ComputeOperationalState(target, current);
UpdateOperationalStatus(MoveType::TILT, state);
@@ -194,7 +199,8 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
// assume single move completed
Instance().mInTiltMove = false;
- VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
+ Protocols::InteractionModel::Status::Success);
if (!TargetCompleted(MoveType::TILT, current, target))
{
@@ -256,7 +262,7 @@ void WindowCovering::UpdateOperationalStatus(MoveType aMoveType, OperationalStat
void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percent100ths aPosition)
{
- EmberAfStatus status{};
+ Protocols::InteractionModel::Status status{};
if (Instance().mCurrentUIMoveType == MoveType::LIFT)
{
status = Attributes::TargetPositionLiftPercent100ths::Set(Endpoint(), aPosition);
@@ -266,7 +272,7 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
status = Attributes::TargetPositionTiltPercent100ths::Set(Endpoint(), aPosition);
}
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Protocols::InteractionModel::Status::Success)
{
LOG_ERR("Cannot set the target position. Error: %d", static_cast(status));
}
@@ -274,13 +280,13 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
void WindowCovering::PositionLEDUpdate(MoveType aMoveType)
{
- EmberAfStatus status{};
+ Protocols::InteractionModel::Status status{};
NPercent100ths currentPosition{};
if (aMoveType == MoveType::LIFT)
{
status = Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), currentPosition);
- if (EMBER_ZCL_STATUS_SUCCESS == status && !currentPosition.IsNull())
+ if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(MoveType::LIFT, currentPosition.Value());
}
@@ -288,7 +294,7 @@ void WindowCovering::PositionLEDUpdate(MoveType aMoveType)
else if (aMoveType == MoveType::TILT)
{
status = Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), currentPosition);
- if (EMBER_ZCL_STATUS_SUCCESS == status && !currentPosition.IsNull())
+ if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(MoveType::TILT, currentPosition.Value());
}
@@ -343,4 +349,6 @@ void WindowCovering::DoPostAttributeChange(intptr_t aArg)
VerifyOrReturn(data != nullptr);
PostAttributeChange(data->mEndpoint, data->mAttributeId);
+
+ chip::Platform::Delete(data);
}
diff --git a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
index 63b9b10d32b852..12e95a7f566788 100644
--- a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
@@ -82,17 +82,17 @@ void MatterWindowCoveringClusterServerAttributeChangedCallback(const app::Concre
void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint)
{
- const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) {
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ 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));
}
};
app::DataModel::Nullable currentPercent100ths;
app::DataModel::Nullable targetPercent100ths;
app::DataModel::Nullable currentPercentage;
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
status = Attributes::CurrentPositionLiftPercentage::Get(endpoint, currentPercentage);
if (currentPercentage.IsNull())
diff --git a/examples/window-app/silabs/openthread.gni b/examples/window-app/silabs/openthread.gni
index cdd7f8c0f1f42e..d3d50ab878b211 100644
--- a/examples/window-app/silabs/openthread.gni
+++ b/examples/window-app/silabs/openthread.gni
@@ -36,6 +36,6 @@ sl_ot_idle_interval_ms = 1000 # 1s Idle Intervals
sl_ot_active_interval_ms = 500 # 500ms Active Intervals
# ICD Matter Configuration flags
-sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval
-sl_active_mode_interval_ms = 0 # 0s Active Mode Interval
+sl_idle_mode_duration_s = 600 # 10min Idle Mode Duration
+sl_active_mode_duration_ms = 0 # 0s Active Mode Duration
sl_active_mode_threshold_ms = 0 # 1s Active Mode Threshold
diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp
index 309fb393565990..58716b82af4a52 100644
--- a/examples/window-app/silabs/src/WindowManager.cpp
+++ b/examples/window-app/silabs/src/WindowManager.cpp
@@ -275,7 +275,7 @@ void WindowManager::Cover::Init(chip::EndpointId endpoint)
void WindowManager::Cover::LiftStepToward(OperationalState direction)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
chip::Percent100ths percent100ths;
NPercent100ths current;
@@ -283,7 +283,7 @@ void WindowManager::Cover::LiftStepToward(OperationalState direction)
status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
percent100ths = ComputePercent100thsStep(direction, current.Value(), LIFT_DELTA);
}
@@ -339,7 +339,7 @@ void WindowManager::Cover::LiftUpdate(bool newTarget)
void WindowManager::Cover::TiltStepToward(OperationalState direction)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
chip::Percent100ths percent100ths;
NPercent100ths current;
@@ -347,7 +347,7 @@ void WindowManager::Cover::TiltStepToward(OperationalState direction)
status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
percent100ths = ComputePercent100thsStep(direction, current.Value(), TILT_DELTA);
}
@@ -403,7 +403,7 @@ void WindowManager::Cover::TiltUpdate(bool newTarget)
void WindowManager::Cover::UpdateTargetPosition(OperationalState direction, bool isTilt)
{
- EmberAfStatus status;
+ Protocols::InteractionModel::Status status;
NPercent100ths current;
chip::Percent100ths target;
@@ -412,7 +412,7 @@ void WindowManager::Cover::UpdateTargetPosition(OperationalState direction, bool
if (isTilt)
{
status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current);
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
target = ComputePercent100thsStep(direction, current.Value(), TILT_DELTA);
(void) Attributes::TargetPositionTiltPercent100ths::Set(mEndpoint, target);
@@ -421,7 +421,7 @@ void WindowManager::Cover::UpdateTargetPosition(OperationalState direction, bool
else
{
status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current);
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
target = ComputePercent100thsStep(direction, current.Value(), LIFT_DELTA);
(void) Attributes::TargetPositionLiftPercent100ths::Set(mEndpoint, target);
diff --git a/examples/window-app/telink/src/WindowCovering.cpp b/examples/window-app/telink/src/WindowCovering.cpp
index a8cae9d37e597b..5c1b8d10559c33 100644
--- a/examples/window-app/telink/src/WindowCovering.cpp
+++ b/examples/window-app/telink/src/WindowCovering.cpp
@@ -59,8 +59,10 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
NPercent100ths target{};
NPercent100ths positionToSet{};
- VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
- VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
+ chip::Protocols::InteractionModel::Status::Success);
+ VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) ==
+ chip::Protocols::InteractionModel::Status::Success);
UpdateOperationalStatus(WindowCoveringType::Lift, ComputeOperationalState(target, current));
@@ -70,7 +72,8 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
// assume single move completed
Instance().mInLiftMove = false;
- VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
+ chip::Protocols::InteractionModel::Status::Success);
if (!TargetCompleted(WindowCoveringType::Lift, current, target))
{
@@ -86,7 +89,7 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
chip::Percent100ths WindowCovering::CalculateSingleStep(WindowCoveringType aMoveType)
{
- EmberAfStatus status{};
+ chip::Protocols::InteractionModel::Status status{};
chip::Percent100ths percent100ths{};
NPercent100ths current{};
OperationalState opState = OperationalState::Stall;
@@ -102,7 +105,7 @@ chip::Percent100ths WindowCovering::CalculateSingleStep(WindowCoveringType aMove
opState = OperationalStateGet(Endpoint(), OperationalStatus::kTilt);
}
- if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull())
+ if ((status == chip::Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
percent100ths = ComputePercent100thsStep(opState, current.Value(), sPercentDelta);
}
@@ -152,8 +155,10 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
NPercent100ths target{};
NPercent100ths positionToSet{};
- VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
- VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
+ chip::Protocols::InteractionModel::Status::Success);
+ VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) ==
+ chip::Protocols::InteractionModel::Status::Success);
UpdateOperationalStatus(WindowCoveringType::Lift, ComputeOperationalState(target, current));
@@ -163,7 +168,8 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
// assume single move completed
Instance().mInTiltMove = false;
- VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) == EMBER_ZCL_STATUS_SUCCESS);
+ VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
+ chip::Protocols::InteractionModel::Status::Success);
if (!TargetCompleted(WindowCoveringType::Tilt, current, target))
{
@@ -225,7 +231,7 @@ void WindowCovering::UpdateOperationalStatus(WindowCoveringType aMoveType, Opera
void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percent100ths aPosition)
{
- EmberAfStatus status{};
+ chip::Protocols::InteractionModel::Status status{};
if (Instance().mCurrentUIMoveType == WindowCoveringType::Lift)
{
status = Attributes::TargetPositionLiftPercent100ths::Set(Endpoint(), aPosition);
@@ -235,7 +241,7 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
status = Attributes::TargetPositionTiltPercent100ths::Set(Endpoint(), aPosition);
}
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != chip::Protocols::InteractionModel::Status::Success)
{
LOG_ERR("Cannot set the target position. Error: %d", static_cast(status));
}
@@ -243,13 +249,13 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
void WindowCovering::PositionLEDUpdate(WindowCoveringType aMoveType)
{
- EmberAfStatus status{};
+ chip::Protocols::InteractionModel::Status status{};
NPercent100ths currentPosition{};
if (aMoveType == WindowCoveringType::Lift)
{
status = Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), currentPosition);
- if (EMBER_ZCL_STATUS_SUCCESS == status && !currentPosition.IsNull())
+ if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(WindowCoveringType::Lift, currentPosition.Value());
}
@@ -257,7 +263,7 @@ void WindowCovering::PositionLEDUpdate(WindowCoveringType aMoveType)
else if (aMoveType == WindowCoveringType::Tilt)
{
status = Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), currentPosition);
- if (EMBER_ZCL_STATUS_SUCCESS == status && !currentPosition.IsNull())
+ if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(WindowCoveringType::Tilt, currentPosition.Value());
}
diff --git a/iwyu.imp b/iwyu.imp
new file mode 100644
index 00000000000000..b7572ff9f5a394
--- /dev/null
+++ b/iwyu.imp
@@ -0,0 +1,22 @@
+# General IWYU command example:
+#
+# iwyu_tool.py \
+# -p out/linux-x64-all-clusters-clang/compile_commands.json \
+# src/lib/core/ \
+# -- \
+# -Xiwyu --mapping_file=$(pwd)/iwyu.imp \
+# -Xiwyu --no_comments \
+# -Xiwyu --comment_style=none \
+# -Xiwyu --cxx17ns \
+# -Xiwyu no_fwd_decls \
+# | tee out/iwyu.out
+#
+# cd out/linux-x64-all-clusters-clang
+#
+# fix_includes.py <../iwyu.out
+#
+[
+ { include: [ '"system/SystemBuildConfig.h"', private, '', public ] },
+ { include: [ '"core/CHIPBuildConfig.h"', private, '', public ] },
+ { include: [ '@"platform/.*/CHIPPlatformConfig.h"', private, '', public ] },
+]
diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py
index 771c92b99cabef..af1bd454b86ddb 100755
--- a/scripts/build/build/targets.py
+++ b/scripts/build/build/targets.py
@@ -152,6 +152,7 @@ def BuildHostTarget():
target.AppendModifier('nodeps', enable_ble=False, enable_wifi=False, enable_thread=False,
crypto_library=HostCryptoLibrary.MBEDTLS, use_clang=True).ExceptIfRe('-(clang|noble|boringssl|mbedtls)')
+ target.AppendModifier('nlfaultinject', use_nl_fault_injection=True)
target.AppendModifier('platform-mdns', use_platform_mdns=True)
target.AppendModifier('minmdns-verbose', minmdns_high_verbosity=True)
target.AppendModifier('libnl', minmdns_address_policy="libnl")
diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py
index 7b7a02d421f097..a6ad8f343e0b16 100644
--- a/scripts/build/builders/host.py
+++ b/scripts/build/builders/host.py
@@ -295,7 +295,7 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
enable_ipv4=True, enable_ble=True, enable_wifi=True,
enable_thread=True, use_tsan=False, use_asan=False, use_ubsan=False,
separate_event_loop=True, fuzzing_type: HostFuzzingType = HostFuzzingType.NONE, use_clang=False,
- interactive_mode=True, extra_tests=False, use_platform_mdns=False, enable_rpcs=False,
+ interactive_mode=True, extra_tests=False, use_nl_fault_injection=False, use_platform_mdns=False, enable_rpcs=False,
use_coverage=False, use_dmalloc=False, minmdns_address_policy=None,
minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None,
enable_test_event_triggers=None):
@@ -368,6 +368,9 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE,
# so setting clang is not correct
raise Exception('Fake host board is always gcc (not clang)')
+ if use_nl_fault_injection:
+ self.extra_gn_options.append('chip_with_nlfaultinjection=true')
+
if minmdns_address_policy:
if use_platform_mdns:
raise Exception('Address policy applies to minmdns only')
diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt
index 6a0b73362b8f5c..3c6a2d3b643d6b 100644
--- a/scripts/build/testdata/all_targets_linux_x64.txt
+++ b/scripts/build/testdata/all_targets_linux_x64.txt
@@ -10,7 +10,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b
esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing]
genio-lighting-app
linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang]
-linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event]
+linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event]
linux-x64-efr32-test-runner[-clang]
imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release]
infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage]
diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh
index c69f9d495fa975..9f7314c14010ad 100755
--- a/scripts/examples/gn_silabs_example.sh
+++ b/scripts/examples/gn_silabs_example.sh
@@ -48,7 +48,7 @@ if [ "$#" == "0" ]; then
$USAGE
- Root Location of the app e.g: examples/lighting-app/efr32/
+ Root Location of the app e.g: examples/lighting-app/silabs/
Desired location for the output files
diff --git a/scripts/helpers/iwyu-check.py b/scripts/helpers/iwyu-check.py
index f4419ccd99ff10..822b85c184766d 100755
--- a/scripts/helpers/iwyu-check.py
+++ b/scripts/helpers/iwyu-check.py
@@ -172,8 +172,8 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
logging.info("============== IWYU output start ================")
logger = logging.info
- while status.poll() is None:
- line = status.stdout.readline().rstrip()
+ for line in status.stdout:
+ line = line.rstrip()
if re.match(r"^warning:.*$", line):
logger = logging.warning
diff --git a/scripts/helpers/platforms/iwyu.imp b/scripts/helpers/platforms/iwyu.imp
index c3d2210b2886dd..06637de3ad3ddb 100644
--- a/scripts/helpers/platforms/iwyu.imp
+++ b/scripts/helpers/platforms/iwyu.imp
@@ -32,7 +32,12 @@
## lib/*
{ include: [ '"lib/core/CHIPError.h"', private, '', public ] },
{ include: [ '"lib/dnssd/ServiceNaming.h"', private, '', public ] },
+
+ ## lib/support/logging/*
+ { include: [ '"lib/support/logging/BinaryLogging.h"', private, '', public ] },
{ include: [ '"lib/support/logging/CHIPLogging.h"', private, '', public ] },
+ { include: [ '"lib/support/logging/Constants.h"', private, '', public ] },
+ { include: [ '"lib/support/logging/TextOnlyLogging.h"', private, '', public ] },
## platform/*
{ include: [ '"platform/NetworkCommissioning.h"', private, '', public ] },
diff --git a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/accessory_server_bridge.py b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/accessory_server_bridge.py
index d3e3403fef4954..a8991deb9b7870 100644
--- a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/accessory_server_bridge.py
+++ b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/accessory_server_bridge.py
@@ -17,6 +17,7 @@
import xmlrpc.client
_DEFAULT_KEY = 'default'
+_DEFAULT_WAIT_FOR_MESSAGE_TIMEOUT_SECONDS = 10
_IP = '127.0.0.1'
_PORT = 9000
@@ -113,9 +114,11 @@ def factoryReset(request):
def waitForMessage(request):
register_key = _get_option(request, 'registerKey', _DEFAULT_KEY)
message = _get_option(request, 'message')
+ timeout_in_seconds = _get_option(
+ request, 'timeoutInSeconds', _DEFAULT_WAIT_FOR_MESSAGE_TIMEOUT_SECONDS)
with xmlrpc.client.ServerProxy(_make_url(), allow_none=True) as proxy:
- proxy.waitForMessage(register_key, [message])
+ proxy.waitForMessage(register_key, [message], timeout_in_seconds)
def createOtaImage(request):
otaImageFilePath = _get_option(request, 'otaImageFilePath')
diff --git a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/delay_commands.py b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/delay_commands.py
index fdb949da9b1449..7586be6de2239a 100644
--- a/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/delay_commands.py
+++ b/scripts/py_matter_yamltests/matter_yamltests/pseudo_clusters/clusters/delay_commands.py
@@ -40,6 +40,7 @@
+
diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py
index 82006643481fd2..fd4ad6f52867b5 100644
--- a/scripts/tests/chiptest/__init__.py
+++ b/scripts/tests/chiptest/__init__.py
@@ -160,6 +160,13 @@ def _GetInDevelopmentTests() -> Set[str]:
}
+def _GetChipToolUnsupportedTests() -> Set[str]:
+ """Tests that fail in chip-tool for some reason"""
+ return {
+ "TestDiagnosticLogsDownloadCommand", # chip-tool does not implement a bdx download command.
+ }
+
+
def _GetDarwinFrameworkToolUnsupportedTests() -> Set[str]:
"""Tests that fail in darwin-framework-tool for some reason"""
return {
@@ -202,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
@@ -258,6 +264,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]:
"Test_TC_RVCCLEANM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_BINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"TestDiagnosticLogs.yaml", # chip-repl does not implement a BDXTransferServerDelegate
+ "TestDiagnosticLogsDownloadCommand.yaml", # chip-repl does not implement the bdx download command
}
@@ -340,7 +347,7 @@ def tests_with_command(chip_tool: str, is_manual: bool):
)
-def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft_unsupported_as_in_development: bool, use_short_run_name: bool):
+def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft_unsupported_as_in_development: bool, treat_chip_tool_unsupported_as_in_development: bool, use_short_run_name: bool):
"""
use_short_run_name should be true if we want the run_name to be "Test_ABC" instead of "some/path/Test_ABC.yaml"
"""
@@ -350,7 +357,8 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft
extra_slow_tests = _GetExtraSlowTests()
in_development_tests = _GetInDevelopmentTests()
chip_repl_unsupported_tests = _GetChipReplUnsupportedTests()
- treat_dft_unsupported_as_in_development_tests = _GetDarwinFrameworkToolUnsupportedTests()
+ dft_unsupported_as_in_development_tests = _GetDarwinFrameworkToolUnsupportedTests()
+ chip_tool_unsupported_as_in_development_tests = _GetChipToolUnsupportedTests()
purposeful_failure_tests = _GetPurposefulFailureTests()
for path in _AllYamlTests():
@@ -384,7 +392,10 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft
else:
run_name = str(path)
- if treat_dft_unsupported_as_in_development and run_name in treat_dft_unsupported_as_in_development_tests:
+ if treat_dft_unsupported_as_in_development and run_name in dft_unsupported_as_in_development_tests:
+ tags.add(TestTag.IN_DEVELOPMENT)
+
+ if treat_chip_tool_unsupported_as_in_development and run_name in chip_tool_unsupported_as_in_development_tests:
tags.add(TestTag.IN_DEVELOPMENT)
yield TestDefinition(
@@ -396,17 +407,17 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, treat_dft
def AllReplYamlTests():
- for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, treat_dft_unsupported_as_in_development=False, use_short_run_name=False):
+ for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, treat_dft_unsupported_as_in_development=False, treat_chip_tool_unsupported_as_in_development=False, use_short_run_name=False):
yield test
def AllChipToolYamlTests():
- for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=False, use_short_run_name=True):
+ for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=False, treat_chip_tool_unsupported_as_in_development=True, use_short_run_name=True):
yield test
def AllDarwinFrameworkToolYamlTests():
- for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=True, use_short_run_name=True):
+ for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, treat_dft_unsupported_as_in_development=True, treat_chip_tool_unsupported_as_in_development=False, use_short_run_name=True):
yield test
diff --git a/scripts/tests/chiptest/accessories.py b/scripts/tests/chiptest/accessories.py
index 60e2136209ec19..99433d7ed88660 100644
--- a/scripts/tests/chiptest/accessories.py
+++ b/scripts/tests/chiptest/accessories.py
@@ -98,12 +98,12 @@ def factoryReset(self, name):
return accessory.factoryReset()
return False
- def waitForMessage(self, name, message):
+ def waitForMessage(self, name, message, timeoutInSeconds=10):
accessory = self.__accessories[name]
if accessory:
# The message param comes directly from the sys.argv[2:] of WaitForMessage.py and should contain a list of strings that
# comprise the entire message to wait for
- return accessory.waitForMessage(' '.join(message))
+ return accessory.waitForMessage(' '.join(message), timeoutInSeconds)
return False
def createOtaImage(self, otaImageFilePath, rawImageFilePath, rawImageContent, vid='0xDEAD', pid='0xBEEF'):
diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py
index fc27c447d222b5..95f7a631928ba4 100644
--- a/scripts/tests/chiptest/test_definition.py
+++ b/scripts/tests/chiptest/test_definition.py
@@ -83,8 +83,8 @@ def factoryReset(self):
def waitForAnyAdvertisement(self):
self.__waitFor("mDNS service published:", self.process, self.outpipe)
- def waitForMessage(self, message):
- self.__waitFor(message, self.process, self.outpipe)
+ def waitForMessage(self, message, timeoutInSeconds=10):
+ self.__waitFor(message, self.process, self.outpipe, timeoutInSeconds)
return True
def kill(self):
@@ -124,7 +124,7 @@ def __startServer(self, runner, command):
self.kvsPathSet.add(value)
return runner.RunSubprocess(app_cmd, name='APP ', wait=False)
- def __waitFor(self, waitForString, server_process, outpipe):
+ def __waitFor(self, waitForString, server_process, outpipe, timeoutInSeconds=10):
logging.debug('Waiting for %s' % waitForString)
start_time = time.monotonic()
@@ -139,7 +139,7 @@ def __waitFor(self, waitForString, server_process, outpipe):
(waitForString, server_process.returncode))
logging.error(died_str)
raise Exception(died_str)
- if time.monotonic() - start_time > 10:
+ if time.monotonic() - start_time > timeoutInSeconds:
raise Exception('Timeout while waiting for %s' % waitForString)
time.sleep(0.1)
ready, self.lastLogIndex = outpipe.CapturedLogContains(
@@ -336,6 +336,13 @@ def Run(self, runner, apps_register, paths: ApplicationPaths, pics_file: str,
# so it will be commissionable again.
app.factoryReset()
+ # It may sometimes be useful to run the same app multiple times depending
+ # on the implementation. So this code creates a duplicate entry but with a different
+ # key.
+ app = App(runner, path)
+ apps_register.add(f'{key}#2', app)
+ app.factoryReset()
+
if dry_run:
tool_storage_dir = None
tool_storage_args = []
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/scripts/tools/nxp/factory_data_generator/custom.py b/scripts/tools/nxp/factory_data_generator/custom.py
index 13b1a34fc98c12..e2f7584e2d7fa2 100644
--- a/scripts/tools/nxp/factory_data_generator/custom.py
+++ b/scripts/tools/nxp/factory_data_generator/custom.py
@@ -96,11 +96,14 @@ def encode(self):
assert (self.private_key is not None)
return self.private_key
- def generate_private_key(self, password):
- keys = load_der_private_key(self.val, password, backend=default_backend())
- self.private_key = keys.private_numbers().private_value.to_bytes(
- 32, byteorder='big'
- )
+ def generate_private_key(self, password, use_sss_blob=False):
+ if use_sss_blob:
+ self.private_key = self.val
+ else:
+ keys = load_der_private_key(self.val, password, backend=default_backend())
+ self.private_key = keys.private_numbers().private_value.to_bytes(
+ 32, byteorder='big'
+ )
class DacCert(FileArgument):
diff --git a/scripts/tools/nxp/factory_data_generator/generate.py b/scripts/tools/nxp/factory_data_generator/generate.py
index a203ac9dee749e..1fb7d91edeedaf 100755
--- a/scripts/tools/nxp/factory_data_generator/generate.py
+++ b/scripts/tools/nxp/factory_data_generator/generate.py
@@ -78,7 +78,7 @@ def __init__(self, args):
self.spake2p = Spake2p()
if self.args.spake2p_verifier is None:
self.spake2p.generate(self.args)
- self.args.dac_key.generate_private_key(self.args.dac_key_password)
+ self.args.dac_key.generate_private_key(self.args.dac_key_password, self.args.dac_key_use_sss_blob)
def _validate_args(self):
if self.args.dac_key_password is None:
@@ -217,6 +217,8 @@ def main():
optional.add_argument("--dac_key_password", type=str,
help="[path] Password to decode DAC Key if available")
+ optional.add_argument("--dac_key_use_sss_blob", action='store_true',
+ help="[bool] If present, DAC private key area is populated by an encrypted blob")
optional.add_argument("--spake2p_verifier", type=Verifier,
help="[base64 str] Already generated spake2p verifier")
optional.add_argument("--aes128_key",
diff --git a/scripts/tools/nxp/factory_data_generator/k32w1/example_convert_dac_private_key.jlink b/scripts/tools/nxp/factory_data_generator/k32w1/example_convert_dac_private_key.jlink
new file mode 100644
index 00000000000000..d31c1370933ace
--- /dev/null
+++ b/scripts/tools/nxp/factory_data_generator/k32w1/example_convert_dac_private_key.jlink
@@ -0,0 +1,16 @@
+reset
+halt
+// Factory data size is one internal flash sector (8K).
+// Factory data address is retrieved from the map file.
+erase 0xec000 0xee000 noreset
+// Load factory data and conversion application, then
+// wait for 10 seconds and load the "real" application.
+loadfile factory_data.bin 0xec000
+loadfile chip-k32w1-light-example-before-conversion.srec
+reset
+go
+Sleep 10000
+loadfile chip-k32w1-light-example-after-conversion.srec
+reset
+go
+quit
\ No newline at end of file
diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn
index 84540e97892e6a..73a0433f73b262 100644
--- a/src/app/BUILD.gn
+++ b/src/app/BUILD.gn
@@ -42,6 +42,13 @@ declare_args() {
chip_im_force_fabric_quota_check = false
enable_eventlist_attribute = false
+
+ # Systems that can spare a bit of RAM for InteractionModelEngine/delegate
+ # pointers should do so (allows InteractionModelEngine decoupling and less usage
+ # of global pointers)
+ chip_im_static_global_interaction_model_engine =
+ current_os != "linux" && current_os != "mac" && current_os != "ios" &&
+ current_os != "android"
}
buildconfig_header("app_buildconfig") {
@@ -57,6 +64,7 @@ buildconfig_header("app_buildconfig") {
"CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION=${chip_subscription_timeout_resumption}",
"CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}",
"CHIP_CONFIG_ENABLE_READ_CLIENT=${chip_enable_read_client}",
+ "CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE=${chip_im_static_global_interaction_model_engine}",
]
visibility = [ ":app_config" ]
@@ -129,6 +137,8 @@ static_library("interaction-model") {
"CASESessionManager.h",
"DeviceProxy.cpp",
"DeviceProxy.h",
+ "InteractionModelDelegatePointers.cpp",
+ "InteractionModelDelegatePointers.h",
"InteractionModelEngine.cpp",
"InteractionModelEngine.h",
"InteractionModelTimeout.h",
@@ -161,6 +171,7 @@ static_library("interaction-model") {
"${chip_root}/src/app/icd/server:observer",
"${chip_root}/src/lib/address_resolve",
"${chip_root}/src/lib/support",
+ "${chip_root}/src/lib/support:static-support",
"${chip_root}/src/protocols/interaction_model",
"${chip_root}/src/protocols/secure_channel",
"${chip_root}/src/system",
diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp
index 6831a8440606b2..d0e5db94197e0d 100644
--- a/src/app/CommandHandler.cpp
+++ b/src/app/CommandHandler.cpp
@@ -214,6 +214,7 @@ Status CommandHandler::ProcessInvokeRequest(System::PacketBufferHandle && payloa
SetGroupRequest(true);
}
+ // When updating this code, please remember to make corresponding changes to TestOnlyInvokeCommandRequestWithFaultsInjected.
VerifyOrReturnError(invokeRequestMessage.GetSuppressResponse(&mSuppressResponse) == CHIP_NO_ERROR, Status::InvalidAction);
VerifyOrReturnError(invokeRequestMessage.GetTimedRequest(&mTimedRequest) == CHIP_NO_ERROR, Status::InvalidAction);
VerifyOrReturnError(invokeRequestMessage.GetInvokeRequests(&invokeRequests) == CHIP_NO_ERROR, Status::InvalidAction);
@@ -911,6 +912,135 @@ void CommandHandler::MoveToState(const State aTargetState)
ChipLogDetail(DataManagement, "Command handler moving to [%10.10s]", GetStateStr());
}
+#if CHIP_WITH_NLFAULTINJECTION
+
+namespace {
+
+CHIP_ERROR TestOnlyExtractCommandPathFromNextInvokeRequest(TLV::TLVReader & invokeRequestsReader,
+ ConcreteCommandPath & concretePath)
+{
+ ReturnErrorOnFailure(invokeRequestsReader.Next(TLV::AnonymousTag()));
+ CommandDataIB::Parser commandData;
+ ReturnErrorOnFailure(commandData.Init(invokeRequestsReader));
+ CommandPathIB::Parser commandPath;
+ ReturnErrorOnFailure(commandData.GetPath(&commandPath));
+ return commandPath.GetConcreteCommandPath(concretePath);
+}
+
+[[maybe_unused]] const char * GetFaultInjectionTypeStr(CommandHandler::NlFaultInjectionType faultType)
+{
+ switch (faultType)
+ {
+ case CommandHandler::NlFaultInjectionType::SeparateResponseMessages:
+ return "Each response will be sent in a separate InvokeResponseMessage. The order of responses will be the same as the "
+ "original request.";
+ case CommandHandler::NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder:
+ return "Each response will be sent in a separate InvokeResponseMessage. The order of responses will be reversed from the "
+ "original request.";
+ case CommandHandler::NlFaultInjectionType::SkipSecondResponse:
+ return "Single InvokeResponseMessages. Dropping response to second request";
+ }
+ VerifyOrDieWithMsg(false, DataManagement, "TH Failure: Unexpected fault type");
+}
+
+} // anonymous namespace
+
+// This method intentionally duplicates code from other sections. While code consolidation
+// is generally preferred, here we prioritize generating a clear crash message to aid in
+// troubleshooting test failures.
+void CommandHandler::TestOnlyInvokeCommandRequestWithFaultsInjected(Messaging::ExchangeContext * ec,
+ System::PacketBufferHandle && payload, bool isTimedInvoke,
+ NlFaultInjectionType faultType)
+{
+ VerifyOrDieWithMsg(ec != nullptr, DataManagement, "TH Failure: Incoming exchange context should not be null");
+ VerifyOrDieWithMsg(mState == State::Idle, DataManagement, "TH Failure: state should be Idle, issue with TH");
+
+ ChipLogProgress(DataManagement, "Response to InvokeRequestMessage overridden by fault injection");
+ ChipLogProgress(DataManagement, " Injecting the following response:%s", GetFaultInjectionTypeStr(faultType));
+
+ mResponseSender.SetExchangeContext(ec);
+ Handle workHandle(this);
+ mResponseSender.WillSendMessage();
+ VerifyOrDieWithMsg(!mResponseSender.IsForGroup(), DataManagement, "DUT Failure: Unexpected Group Command");
+
+ System::PacketBufferTLVReader reader;
+ InvokeRequestMessage::Parser invokeRequestMessage;
+ InvokeRequests::Parser invokeRequests;
+ reader.Init(std::move(payload));
+ VerifyOrDieWithMsg(invokeRequestMessage.Init(reader) == CHIP_NO_ERROR, DataManagement,
+ "TH Failure: Failed 'invokeRequestMessage.Init(reader)'");
+#if CHIP_CONFIG_IM_PRETTY_PRINT
+ invokeRequestMessage.PrettyPrint();
+#endif
+
+ VerifyOrDieWithMsg(invokeRequestMessage.GetSuppressResponse(&mSuppressResponse) == CHIP_NO_ERROR, DataManagement,
+ "DUT Failure: Mandatory SuppressResponse field missing");
+ VerifyOrDieWithMsg(invokeRequestMessage.GetTimedRequest(&mTimedRequest) == CHIP_NO_ERROR, DataManagement,
+ "DUT Failure: Mandatory TimedRequest field missing");
+ VerifyOrDieWithMsg(invokeRequestMessage.GetInvokeRequests(&invokeRequests) == CHIP_NO_ERROR, DataManagement,
+ "DUT Failure: Mandatory InvokeRequests field missing");
+ VerifyOrDieWithMsg(mTimedRequest == isTimedInvoke, DataManagement,
+ "DUT Failure: TimedRequest value in message mismatches action");
+
+ {
+ InvokeRequestMessage::Parser validationInvokeRequestMessage = invokeRequestMessage;
+ VerifyOrDieWithMsg(ValidateInvokeRequestMessageAndBuildRegistry(validationInvokeRequestMessage) == CHIP_NO_ERROR,
+ DataManagement, "DUT Failure: InvokeRequestMessage contents were invalid");
+ }
+
+ TLV::TLVReader invokeRequestsReader;
+ invokeRequests.GetReader(&invokeRequestsReader);
+
+ size_t commandCount = 0;
+ VerifyOrDieWithMsg(TLV::Utilities::Count(invokeRequestsReader, commandCount, false /* recurse */) == CHIP_NO_ERROR,
+ DataManagement,
+ "TH Failure: Failed to get the length of InvokeRequests after InvokeRequestMessage validation");
+
+ // The command count check (specifically for a count of 2) is tied to IDM_1_3. This may need adjustment for
+ // compatibility with future test plans.
+ VerifyOrDieWithMsg(commandCount == 2, DataManagement, "DUT failure: We were strictly expecting exactly 2 InvokeRequests");
+ mReserveSpaceForMoreChunkMessages = true;
+
+ {
+ // Response path is the same as request path since we are replying with a failure message.
+ ConcreteCommandPath concreteResponsePath1;
+ ConcreteCommandPath concreteResponsePath2;
+ VerifyOrDieWithMsg(
+ TestOnlyExtractCommandPathFromNextInvokeRequest(invokeRequestsReader, concreteResponsePath1) == CHIP_NO_ERROR,
+ DataManagement, "DUT Failure: Issues encountered while extracting the ConcreteCommandPath from the first request");
+ VerifyOrDieWithMsg(
+ TestOnlyExtractCommandPathFromNextInvokeRequest(invokeRequestsReader, concreteResponsePath2) == CHIP_NO_ERROR,
+ DataManagement, "DUT Failure: Issues encountered while extracting the ConcreteCommandPath from the second request");
+
+ if (faultType == NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder)
+ {
+ ConcreteCommandPath temp(concreteResponsePath1);
+ concreteResponsePath1 = concreteResponsePath2;
+ concreteResponsePath2 = temp;
+ }
+
+ VerifyOrDieWithMsg(FallibleAddStatus(concreteResponsePath1, Status::Failure) == CHIP_NO_ERROR, DataManagement,
+ "TH Failure: Error adding the first InvokeResponse");
+ if (faultType == NlFaultInjectionType::SeparateResponseMessages ||
+ faultType == NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder)
+ {
+ VerifyOrDieWithMsg(FinalizeInvokeResponseMessageAndPrepareNext() == CHIP_NO_ERROR, DataManagement,
+ "TH Failure: Failed to create second InvokeResponseMessage");
+ }
+ if (faultType != NlFaultInjectionType::SkipSecondResponse)
+ {
+ VerifyOrDieWithMsg(FallibleAddStatus(concreteResponsePath2, Status::Failure) == CHIP_NO_ERROR, DataManagement,
+ "TH Failure: Error adding the second InvokeResponse");
+ }
+ }
+
+ VerifyOrDieWithMsg(invokeRequestsReader.Next() == CHIP_END_OF_TLV, DataManagement,
+ "DUT Failure: Unexpected TLV ending of InvokeRequests");
+ VerifyOrDieWithMsg(invokeRequestMessage.ExitContainer() == CHIP_NO_ERROR, DataManagement,
+ "DUT Failure: InvokeRequestMessage TLV is not properly terminated");
+}
+#endif // CHIP_WITH_NLFAULTINJECTION
+
} // namespace app
} // namespace chip
diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h
index b90cb821244336..f7acd709b26808 100644
--- a/src/app/CommandHandler.h
+++ b/src/app/CommandHandler.h
@@ -429,6 +429,35 @@ class CommandHandler
return mResponseSender.GetSubjectDescriptor();
}
+#if CHIP_WITH_NLFAULTINJECTION
+
+ enum class NlFaultInjectionType : uint8_t
+ {
+ SeparateResponseMessages,
+ SeparateResponseMessagesAndInvertedResponseOrder,
+ SkipSecondResponse
+ };
+
+ /**
+ * @brief Sends InvokeResponseMessages with injected faults for certification testing.
+ *
+ * The Test Harness (TH) uses this to simulate various server response behaviors,
+ * ensuring the Device Under Test (DUT) handles responses per specification.
+ *
+ * This function strictly validates the DUT's InvokeRequestMessage against the test plan.
+ * If deviations occur, the TH terminates with a detailed error message.
+ *
+ * @param ec Exchange context for sending InvokeResponseMessages to the client.
+ * @param payload Payload of the incoming InvokeRequestMessage from the client.
+ * @param isTimedInvoke Indicates whether the interaction is timed.
+ * @param faultType The specific type of fault to inject into the response.
+ */
+ // TODO(#30453): After refactoring CommandHandler for better unit testability, create a
+ // unit test specifically for the fault injection behavior.
+ void TestOnlyInvokeCommandRequestWithFaultsInjected(Messaging::ExchangeContext * ec, System::PacketBufferHandle && payload,
+ bool isTimedInvoke, NlFaultInjectionType faultType);
+#endif // CHIP_WITH_NLFAULTINJECTION
+
private:
friend class TestCommandInteraction;
friend class CommandHandler::Handle;
diff --git a/src/app/ConcreteCommandPath.h b/src/app/ConcreteCommandPath.h
index 5020aa0ba6d2c0..42845b64241053 100644
--- a/src/app/ConcreteCommandPath.h
+++ b/src/app/ConcreteCommandPath.h
@@ -33,6 +33,8 @@ struct ConcreteCommandPath : public ConcreteClusterPath
ConcreteClusterPath(aEndpointId, aClusterId), mCommandId(aCommandId)
{}
+ ConcreteCommandPath() : ConcreteClusterPath(kInvalidEndpointId, kInvalidClusterId), mCommandId(kInvalidCommandId) {}
+
bool operator==(const ConcreteCommandPath & aOther) const
{
return ConcreteClusterPath::operator==(aOther) && (mCommandId == aOther.mCommandId);
diff --git a/src/app/InteractionModelDelegatePointers.cpp b/src/app/InteractionModelDelegatePointers.cpp
new file mode 100644
index 00000000000000..af4c85ee1bb1c2
--- /dev/null
+++ b/src/app/InteractionModelDelegatePointers.cpp
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright (c) 2024 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+#include "InteractionModelDelegatePointers.h"
+
+#if CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE
+
+// TODO: It would be nice to not need to couple the pointers class
+// to the global interaction model engine
+#include "InteractionModelEngine.h"
+
+namespace chip {
+
+template <>
+app::TimedHandlerDelegate * GlobalInstanceProvider::InstancePointer()
+{
+ return app::InteractionModelEngine::GetInstance();
+}
+
+} // namespace chip
+
+#endif
diff --git a/src/app/InteractionModelDelegatePointers.h b/src/app/InteractionModelDelegatePointers.h
new file mode 100644
index 00000000000000..6677022b5561cb
--- /dev/null
+++ b/src/app/InteractionModelDelegatePointers.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (c) 2024 Project CHIP Authors
+ * All rights reserved.
+ *
+ * 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.
+ */
+#pragma once
+
+#include
+#include
+
+namespace chip {
+
+#if CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE
+
+template
+using InteractionModelDelegatePointer = chip::CheckedGlobalInstanceReference;
+
+#else
+
+template
+using InteractionModelDelegatePointer = chip::SimpleInstanceReference;
+
+#endif // CHIP_CONFIG_STATIC_GLOBAL_INTERATION_MODEL_ENGINE
+
+} // namespace chip
diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp
index 98cb6ff156a653..ddc8a984f16b72 100644
--- a/src/app/InteractionModelEngine.cpp
+++ b/src/app/InteractionModelEngine.cpp
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
#include
#include
@@ -411,6 +412,21 @@ Status InteractionModelEngine::OnInvokeCommandRequest(Messaging::ExchangeContext
ChipLogProgress(InteractionModel, "no resource for Invoke interaction");
return Status::Busy;
}
+ CHIP_FAULT_INJECT(
+ FaultInjection::kFault_IMInvoke_SeparateResponses,
+ commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected(
+ apExchangeContext, std::move(aPayload), aIsTimedInvoke, CommandHandler::NlFaultInjectionType::SeparateResponseMessages);
+ return Status::Success;);
+ CHIP_FAULT_INJECT(FaultInjection::kFault_IMInvoke_SeparateResponsesInvertResponseOrder,
+ commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected(
+ apExchangeContext, std::move(aPayload), aIsTimedInvoke,
+ CommandHandler::NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder);
+ return Status::Success;);
+ CHIP_FAULT_INJECT(
+ FaultInjection::kFault_IMInvoke_SkipSecondResponse,
+ commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected(apExchangeContext, std::move(aPayload), aIsTimedInvoke,
+ CommandHandler::NlFaultInjectionType::SkipSecondResponse);
+ return Status::Success;);
commandHandler->OnInvokeCommandRequest(apExchangeContext, aPayloadHeader, std::move(aPayload), aIsTimedInvoke);
return Status::Success;
}
@@ -840,7 +856,7 @@ CHIP_ERROR InteractionModelEngine::OnTimedRequest(Messaging::ExchangeContext * a
const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload,
Protocols::InteractionModel::Status & aStatus)
{
- TimedHandler * handler = mTimedHandlers.CreateObject();
+ TimedHandler * handler = mTimedHandlers.CreateObject(this);
if (handler == nullptr)
{
ChipLogProgress(InteractionModel, "no resource for Timed interaction");
diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h
index 8ed201a0d934e6..b222087867380f 100644
--- a/src/app/InteractionModelEngine.h
+++ b/src/app/InteractionModelEngine.h
@@ -80,7 +80,8 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler,
public CommandHandler::Callback,
public ReadHandler::ManagementCallback,
public FabricTable::Delegate,
- public SubscriptionsInfoProvider
+ public SubscriptionsInfoProvider,
+ public TimedHandlerDelegate
{
public:
/**
@@ -218,26 +219,12 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler,
}
void UnregisterReadHandlerAppCallback() { mpReadHandlerApplicationCallback = nullptr; }
- /**
- * Called when a timed interaction has failed (i.e. the exchange it was
- * happening on has closed while the exchange delegate was the timed
- * handler).
- */
- void OnTimedInteractionFailed(TimedHandler * apTimedHandler);
-
- /**
- * Called when a timed invoke is received. This function takes over all
- * handling of the exchange, status reporting, and so forth.
- */
+ // TimedHandlerDelegate implementation
+ void OnTimedInteractionFailed(TimedHandler * apTimedHandler) override;
void OnTimedInvoke(TimedHandler * apTimedHandler, Messaging::ExchangeContext * apExchangeContext,
- const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload);
-
- /**
- * Called when a timed write is received. This function takes over all
- * handling of the exchange, status reporting, and so forth.
- */
+ const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override;
void OnTimedWrite(TimedHandler * apTimedHandler, Messaging::ExchangeContext * apExchangeContext,
- const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload);
+ const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override;
#if CHIP_CONFIG_ENABLE_READ_CLIENT
/**
diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h
index d602273a8611a9..71070c357147df 100644
--- a/src/app/ReadHandler.h
+++ b/src/app/ReadHandler.h
@@ -275,7 +275,7 @@ class ReadHandler : public Messaging::ExchangeDelegate
/**
* Returns SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT
- * For an ICD publisher, this SHALL be set to the idle mode interval.
+ * For an ICD publisher, this SHALL be set to the idle mode duration.
* Otherwise, this SHALL be set to 60 minutes.
*/
uint16_t GetPublisherSelectedIntervalLimit();
diff --git a/src/app/TimedHandler.cpp b/src/app/TimedHandler.cpp
index d448784721ac59..8df0246ba26728 100644
--- a/src/app/TimedHandler.cpp
+++ b/src/app/TimedHandler.cpp
@@ -17,7 +17,7 @@
*/
#include "TimedHandler.h"
-#include
+#include
#include
#include
#include
@@ -74,19 +74,17 @@ CHIP_ERROR TimedHandler::OnMessageReceived(Messaging::ExchangeContext * aExchang
if (aPayloadHeader.HasMessageType(MsgType::InvokeCommandRequest))
{
- auto * imEngine = InteractionModelEngine::GetInstance();
ChipLogDetail(DataManagement, "Handing timed invoke to IM engine: handler %p exchange " ChipLogFormatExchange, this,
ChipLogValueExchange(aExchangeContext));
- imEngine->OnTimedInvoke(this, aExchangeContext, aPayloadHeader, std::move(aPayload));
+ mDelegate->OnTimedInvoke(this, aExchangeContext, aPayloadHeader, std::move(aPayload));
return CHIP_NO_ERROR;
}
if (aPayloadHeader.HasMessageType(MsgType::WriteRequest))
{
- auto * imEngine = InteractionModelEngine::GetInstance();
ChipLogDetail(DataManagement, "Handing timed write to IM engine: handler %p exchange " ChipLogFormatExchange, this,
ChipLogValueExchange(aExchangeContext));
- imEngine->OnTimedWrite(this, aExchangeContext, aPayloadHeader, std::move(aPayload));
+ mDelegate->OnTimedWrite(this, aExchangeContext, aPayloadHeader, std::move(aPayload));
return CHIP_NO_ERROR;
}
}
@@ -101,7 +99,7 @@ CHIP_ERROR TimedHandler::OnMessageReceived(Messaging::ExchangeContext * aExchang
void TimedHandler::OnExchangeClosing(Messaging::ExchangeContext *)
{
- InteractionModelEngine::GetInstance()->OnTimedInteractionFailed(this);
+ mDelegate->OnTimedInteractionFailed(this);
}
CHIP_ERROR TimedHandler::HandleTimedRequestAction(Messaging::ExchangeContext * aExchangeContext,
diff --git a/src/app/TimedHandler.h b/src/app/TimedHandler.h
index 47faa9d5940946..e47bfb7b49e1e6 100644
--- a/src/app/TimedHandler.h
+++ b/src/app/TimedHandler.h
@@ -15,15 +15,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-/**
- * @file
- * Definition of a handler for timed interactions.
- *
- */
-
#pragma once
+#include
#include
#include
#include
@@ -31,6 +25,11 @@
#include
#include
+namespace chip {
+namespace app {
+
+class TimedHandler;
+
/**
* A TimedHandler handles a Timed Request action and then waits for a
* subsequent Invoke or Write action and hands those on to
@@ -43,14 +42,37 @@
* either the exchange is closed or the interaction is handed on to the
* InteractionModelEngine.
*/
+class TimedHandlerDelegate
+{
+public:
+ virtual ~TimedHandlerDelegate() = default;
-namespace chip {
-namespace app {
+ /**
+ * Called when a timed invoke is received. This function takes over all
+ * handling of the exchange, status reporting, and so forth.
+ */
+ virtual void OnTimedInvoke(TimedHandler * apTimedHandler, Messaging::ExchangeContext * apExchangeContext,
+ const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) = 0;
+
+ /**
+ * Called when a timed write is received. This function takes over all
+ * handling of the exchange, status reporting, and so forth.
+ */
+ virtual void OnTimedWrite(TimedHandler * apTimedHandler, Messaging::ExchangeContext * apExchangeContext,
+ const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) = 0;
+
+ /**
+ * Called when a timed interaction has failed (i.e. the exchange it was
+ * happening on has closed while the exchange delegate was the timed
+ * handler).
+ */
+ virtual void OnTimedInteractionFailed(TimedHandler * apTimedHandler) = 0;
+};
class TimedHandler : public Messaging::ExchangeDelegate
{
public:
- TimedHandler() {}
+ TimedHandler(TimedHandlerDelegate * delegate) : mDelegate(delegate) {}
~TimedHandler() override {}
// ExchangeDelegate implementation.
@@ -83,15 +105,31 @@ class TimedHandler : public Messaging::ExchangeDelegate
kExpectingFollowingAction, // Expecting write or invoke.
};
- // Because we have a vtable pointer and mTimeLimit needs to be 8-byte
- // aligned on ARM, putting mState first here means we fit in 16 bytes on
- // 32-bit ARM, whereas if we put it second we'd be 24 bytes.
- // On platforms where either vtable pointers are 8 bytes or 64-bit ints can
- // be 4-byte-aligned the ordering here does not matter.
State mState = State::kExpectingTimedAction;
+
+ /// This may be "fake" pointer or a real delegate pointer, depending
+ /// on CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE setting.
+ ///
+ /// When this is not a real pointer, it checks that the value is always
+ /// set to the global InteractionModelEngine and the size of this
+ /// member is 1 byte.
+ InteractionModelDelegatePointer mDelegate;
+
// We keep track of the time limit for message reception, in case our
// exchange's "response expected" timer gets delayed and does not fire when
// the time runs out.
+ //
+ // NOTE: mTimeLimit needs to be 8-byte aligned on ARM so we place this last,
+ // to allow previous values to potentially use remaining packing space.
+ // Rationale:
+ // - vtable is 4-byte aligned on 32-bit arm
+ // - mTimeLimit requires 8-byte aligment
+ // => As a result we may gain 4 bytes if we place mTimeLimit last.
+ // Expectation of memory layout:
+ // - vtable pointer (4 bytes & 4 byte alignment)
+ // - other members (2 bytes on embedded "global pointer" arm)
+ // (2 bytes padding for 8-byte alignment)
+ // - mTimeLimit (8 bytes & 8 byte alignment)
System::Clock::Timestamp mTimeLimit;
};
diff --git a/src/app/app-platform/ContentApp.cpp b/src/app/app-platform/ContentApp.cpp
index 571561454162ac..3bc16e9555ced5 100644
--- a/src/app/app-platform/ContentApp.cpp
+++ b/src/app/app-platform/ContentApp.cpp
@@ -29,35 +29,37 @@
#include
#include
#include
+#include
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
using namespace chip;
using namespace chip::AppPlatform;
+using chip::Protocols::InteractionModel::Status;
+
namespace chip {
namespace AppPlatform {
#define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u)
#define ZCL_APPLICATION_BASIC_CLUSTER_REVISION (1u)
-EmberAfStatus ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
- uint16_t maxReadLength)
+Status ContentApp::HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength)
{
ChipLogProgress(DeviceLayer,
"Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
-EmberAfStatus ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
+Status ContentApp::HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer)
{
ChipLogProgress(DeviceLayer,
"Read Attribute for endpoint " ChipLogFormatMEI " cluster " ChipLogFormatMEI " attribute " ChipLogFormatMEI,
ChipLogValueMEI(mEndpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
} // namespace AppPlatform
diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h
index 6fed23cf7d64da..d3b7d1fb2b2187 100644
--- a/src/app/app-platform/ContentApp.h
+++ b/src/app/app-platform/ContentApp.h
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
namespace chip {
namespace AppPlatform {
@@ -65,8 +66,9 @@ class DLL_EXPORT ContentApp
virtual MediaPlaybackDelegate * GetMediaPlaybackDelegate() = 0;
virtual TargetNavigatorDelegate * GetTargetNavigatorDelegate() = 0;
- EmberAfStatus HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength);
- EmberAfStatus HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
+ Protocols::InteractionModel::Status HandleReadAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer,
+ uint16_t maxReadLength);
+ Protocols::InteractionModel::Status HandleWriteAttribute(ClusterId clusterId, AttributeId attributeId, uint8_t * buffer);
protected:
EndpointId mEndpointId = 0;
diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp
index bb4638c45d95ba..abcaa981843037 100644
--- a/src/app/app-platform/ContentAppPlatform.cpp
+++ b/src/app/app-platform/ContentAppPlatform.cpp
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
@@ -41,19 +42,20 @@ using namespace chip::app::Clusters;
using namespace chip::Access;
using ApplicationStatusEnum = app::Clusters::ApplicationBasic::ApplicationStatusEnum;
using GetSetupPINResponseType = app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type;
+using chip::Protocols::InteractionModel::Status;
// Device Version for dynamic endpoints:
#define DEVICE_VERSION_DEFAULT 1
-EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength)
+Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
+ uint16_t maxReadLength)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
ChipLogDetail(DeviceLayer, "emberAfExternalAttributeReadCallback endpoint %d ", endpointIndex);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Status ret = Status::Failure;
ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
if (app != nullptr)
@@ -68,14 +70,14 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
return ret;
}
-EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
+Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
{
uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint);
ChipLogDetail(DeviceLayer, "emberAfExternalAttributeWriteCallback endpoint %d ", endpointIndex);
- EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE;
+ Status ret = Status::Failure;
ContentApp * app = ContentAppPlatform::GetInstance().GetContentApp(endpoint);
if (app != nullptr)
@@ -93,18 +95,18 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
namespace chip {
namespace AppPlatform {
-EmberAfStatus __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata,
- uint8_t * buffer, uint16_t maxReadLength)
+Status __attribute__((weak)) AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength)
{
- return (EMBER_ZCL_STATUS_FAILURE);
+ return (Status::Failure);
}
-EmberAfStatus __attribute__((weak))
+Status __attribute__((weak))
AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer)
{
- return (EMBER_ZCL_STATUS_FAILURE);
+ return (Status::Failure);
}
EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointType * ep,
diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h
index 3dd0b138d2e9d1..16a47c26a3b991 100644
--- a/src/app/app-platform/ContentAppPlatform.h
+++ b/src/app/app-platform/ContentAppPlatform.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include
using chip::app::Clusters::ApplicationBasic::CatalogVendorApp;
@@ -40,14 +41,15 @@ namespace AppPlatform {
// The AppPlatform overrides emberAfExternalAttributeReadCallback to handle external attribute reads for ContentApps.
// This callback can be used to handle external attribute reads for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer,
- uint16_t maxReadLength);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer, uint16_t maxReadLength);
// The AppPlatform overrides emberAfExternalAttributeWriteCallback to handle external attribute writes for ContentApps.
// This callback can be used to handle external attribute writes for attributes belonging to static endpoints.
-EmberAfStatus AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
- const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer);
+Protocols::InteractionModel::Status AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId,
+ const EmberAfAttributeMetadata * attributeMetadata,
+ uint8_t * buffer);
inline constexpr EndpointId kTargetBindingClusterEndpointId = 0;
inline constexpr EndpointId kLocalVideoPlayerEndpointId = 1;
@@ -157,7 +159,7 @@ class DLL_EXPORT ContentAppPlatform
// loads given app and calls HandleGetSetupPasscode. Sets passcode to 0 if it cannot be obtained.
// return true if a matching app was found (and it granted this client access), even if a passcode was not obtained
bool HasTargetContentApp(uint16_t vendorId, uint16_t productId, CharSpan rotatingId,
- chip::Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
+ Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode);
/**
* @brief
diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp
index aa939ae810bb10..684558eec0f0bc 100644
--- a/src/app/clusters/account-login-server/account-login-server.cpp
+++ b/src/app/clusters/account-login-server/account-login-server.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include
diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
index aa72d8ad499620..18a30bb1190659 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp
+++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
@@ -116,8 +116,8 @@ bool HasFeature(chip::EndpointId endpoint, Feature feature)
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp
index f47fc528456a78..297d1ea9d8d8b3 100644
--- a/src/app/clusters/audio-output-server/audio-output-server.cpp
+++ b/src/app/clusters/audio-output-server/audio-output-server.cpp
@@ -92,8 +92,8 @@ bool HasFeature(chip::EndpointId endpoint, Feature feature)
bool hasFeature = false;
uint32_t featureMap = 0;
- EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ Status status = Attributes::FeatureMap::Get(endpoint, &featureMap);
+ if (Status::Success == status)
{
hasFeature = (featureMap & chip::to_underlying(feature));
}
diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
index e4e72eeb2ae930..99bd0621ba793d 100644
--- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp
+++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
@@ -102,29 +102,29 @@ static void cancelEndpointTimerCallback(EndpointId endpoint)
uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint)
{
uint8_t position;
- EmberAfStatus status = Attributes::BarrierPosition::Get(endpoint, &position);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierPosition::Get(endpoint, &position);
+ assert(status == Status::Success);
return position;
}
void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position)
{
- EmberAfStatus status = Attributes::BarrierPosition::Set(endpoint, position);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierPosition::Set(endpoint, position);
+ assert(status == Status::Success);
}
bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint)
{
uint8_t bitmap;
- EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap);
+ assert(status == Status::Success);
return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0;
}
static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
{
- uint16_t period = 0;
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ uint16_t period = 0;
+ Status status = Status::Success;
#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE)
if (open)
{
@@ -137,21 +137,21 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
status = Attributes::BarrierClosePeriod::Get(endpoint, &period);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
return period;
}
static void setMovingState(EndpointId endpoint, uint8_t newState)
{
- EmberAfStatus status = Attributes::BarrierMovingState::Set(endpoint, newState);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierMovingState::Set(endpoint, newState);
+ assert(status == Status::Success);
}
uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint)
{
uint16_t safetyStatus;
- EmberAfStatus status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ Status status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus);
+ assert(status == Status::Success);
return safetyStatus;
}
@@ -163,8 +163,8 @@ static bool isRemoteLockoutOn(EndpointId endpoint)
void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- uint16_t events = 0;
+ Status status = Status::Success;
+ uint16_t events = 0;
#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE)
if (open && !command)
@@ -190,7 +190,7 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope
status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
// Section 7.1.2.1.5-8 says that this events counter SHALL NOT roll over.
// The maximum 16-bit unsigned integer in Zigbee is 0xFFFE, so we have this
@@ -225,7 +225,7 @@ void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool ope
status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events);
}
#endif
- assert(status == EMBER_ZCL_STATUS_SUCCESS);
+ assert(status == Status::Success);
}
// -----------------------------------------------------------------------------
diff --git a/src/app/clusters/basic-information/basic-information.cpp b/src/app/clusters/basic-information/basic-information.cpp
index f241bb2cf5a008..641dc59a853dd6 100644
--- a/src/app/clusters/basic-information/basic-information.cpp
+++ b/src/app/clusters/basic-information/basic-information.cpp
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
@@ -41,6 +42,7 @@ using namespace chip::app::Clusters;
using namespace chip::app::Clusters::BasicInformation;
using namespace chip::app::Clusters::BasicInformation::Attributes;
using namespace chip::DeviceLayer;
+using chip::Protocols::InteractionModel::Status;
namespace {
@@ -463,9 +465,9 @@ namespace Clusters {
namespace BasicInformation {
bool IsLocalConfigDisabled()
{
- bool disabled = false;
- EmberAfStatus status = LocalConfigDisabled::Get(0, &disabled);
- return status == EMBER_ZCL_STATUS_SUCCESS && disabled;
+ bool disabled = false;
+ Status status = LocalConfigDisabled::Get(0, &disabled);
+ return status == Status::Success && disabled;
}
} // namespace BasicInformation
} // namespace Clusters
diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp
index 7243fdcfb3b744..b765146ed55153 100644
--- a/src/app/clusters/bindings/BindingManager.cpp
+++ b/src/app/clusters/bindings/BindingManager.cpp
@@ -88,7 +88,7 @@ CHIP_ERROR BindingManager::Init(const BindingManagerInitParams & params)
{
for (const EmberBindingTableEntry & entry : BindingTable::GetInstance())
{
- if (entry.type == EMBER_UNICAST_BINDING)
+ if (entry.type == MATTER_UNICAST_BINDING)
{
// The CASE connection can also fail if the unicast peer is offline.
// There is recovery mechanism to retry connection on-demand so ignore error.
@@ -187,14 +187,14 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste
{
if (iter->local == endpoint && (!iter->clusterId.HasValue() || iter->clusterId.Value() == cluster))
{
- if (iter->type == EMBER_UNICAST_BINDING)
+ if (iter->type == MATTER_UNICAST_BINDING)
{
error = mPendingNotificationMap.AddPendingNotification(iter.GetIndex(), bindingContext);
SuccessOrExit(error);
error = EstablishConnection(ScopedNodeId(iter->nodeId, iter->fabricIndex));
SuccessOrExit(error);
}
- else if (iter->type == EMBER_MULTICAST_BINDING)
+ else if (iter->type == MATTER_MULTICAST_BINDING)
{
mBoundDeviceChangedHandler(*iter, nullptr, bindingContext->GetContext());
}
diff --git a/src/app/clusters/bindings/PendingNotificationMap.cpp b/src/app/clusters/bindings/PendingNotificationMap.cpp
index 3499bddc090046..a7299b2d1f4663 100644
--- a/src/app/clusters/bindings/PendingNotificationMap.cpp
+++ b/src/app/clusters/bindings/PendingNotificationMap.cpp
@@ -30,17 +30,17 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(ScopedNodeId & nodeId)
// to the start of the list than the last entry of any other peer.
// First, set up a way to easily track which entries correspond to the same peer.
- uint8_t bindingWithSamePeer[EMBER_BINDING_TABLE_SIZE];
+ uint8_t bindingWithSamePeer[MATTER_BINDING_TABLE_SIZE];
for (auto iter = BindingTable::GetInstance().begin(); iter != BindingTable::GetInstance().end(); ++iter)
{
- if (iter->type != EMBER_UNICAST_BINDING)
+ if (iter->type != MATTER_UNICAST_BINDING)
{
continue;
}
for (auto checkIter = BindingTable::GetInstance().begin(); checkIter != BindingTable::GetInstance().end(); ++checkIter)
{
- if (checkIter->type == EMBER_UNICAST_BINDING && checkIter->fabricIndex == iter->fabricIndex &&
+ if (checkIter->type == MATTER_UNICAST_BINDING && checkIter->fabricIndex == iter->fabricIndex &&
checkIter->nodeId == iter->nodeId)
{
bindingWithSamePeer[iter.GetIndex()] = checkIter.GetIndex();
@@ -49,7 +49,7 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(ScopedNodeId & nodeId)
}
}
- uint16_t lastAppear[EMBER_BINDING_TABLE_SIZE];
+ uint16_t lastAppear[MATTER_BINDING_TABLE_SIZE];
for (uint16_t & value : lastAppear)
{
value = UINT16_MAX;
@@ -62,7 +62,7 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(ScopedNodeId & nodeId)
}
uint8_t lruBindingEntryIndex;
uint16_t minLastAppearValue = UINT16_MAX;
- for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++)
+ for (uint8_t i = 0; i < MATTER_BINDING_TABLE_SIZE; i++)
{
if (lastAppear[i] < minLastAppearValue)
{
@@ -82,7 +82,7 @@ CHIP_ERROR PendingNotificationMap::FindLRUConnectPeer(ScopedNodeId & nodeId)
CHIP_ERROR PendingNotificationMap::AddPendingNotification(uint8_t bindingEntryId, PendingNotificationContext * context)
{
RemoveEntry(bindingEntryId);
- if (mNumEntries == EMBER_BINDING_TABLE_SIZE)
+ if (mNumEntries == MATTER_BINDING_TABLE_SIZE)
{
// We know that the RemoveEntry above did not do anything so we don't need to try restoring it.
return CHIP_ERROR_NO_MEMORY;
diff --git a/src/app/clusters/bindings/PendingNotificationMap.h b/src/app/clusters/bindings/PendingNotificationMap.h
index d0697b0dac32ff..c06a0a426d434c 100644
--- a/src/app/clusters/bindings/PendingNotificationMap.h
+++ b/src/app/clusters/bindings/PendingNotificationMap.h
@@ -68,7 +68,7 @@ struct PendingNotificationEntry
class PendingNotificationMap
{
public:
- static constexpr uint8_t kMaxPendingNotifications = EMBER_BINDING_TABLE_SIZE;
+ static constexpr uint8_t kMaxPendingNotifications = MATTER_BINDING_TABLE_SIZE;
friend class Iterator;
diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp
index 22c4fba0be6920..7e0f3ce306da32 100644
--- a/src/app/clusters/bindings/bindings.cpp
+++ b/src/app/clusters/bindings/bindings.cpp
@@ -114,7 +114,7 @@ CHIP_ERROR CheckValidBindingList(const EndpointId localEndpoint, const Decodable
oldListSize++;
}
}
- ReturnErrorCodeIf(BindingTable::GetInstance().Size() - oldListSize + listSize > EMBER_BINDING_TABLE_SIZE,
+ ReturnErrorCodeIf(BindingTable::GetInstance().Size() - oldListSize + listSize > MATTER_BINDING_TABLE_SIZE,
CHIP_IM_GLOBAL_STATUS(ResourceExhausted));
return CHIP_NO_ERROR;
}
@@ -153,7 +153,7 @@ CHIP_ERROR BindingTableAccess::ReadBindingTable(EndpointId endpoint, AttributeVa
return encoder.EncodeList([&](const auto & subEncoder) {
for (const EmberBindingTableEntry & entry : BindingTable::GetInstance())
{
- if (entry.local == endpoint && entry.type == EMBER_UNICAST_BINDING)
+ if (entry.local == endpoint && entry.type == MATTER_UNICAST_BINDING)
{
Binding::Structs::TargetStruct::Type value = {
.node = MakeOptional(entry.nodeId),
@@ -164,7 +164,7 @@ CHIP_ERROR BindingTableAccess::ReadBindingTable(EndpointId endpoint, AttributeVa
};
ReturnErrorOnFailure(subEncoder.Encode(value));
}
- else if (entry.local == endpoint && entry.type == EMBER_MULTICAST_BINDING)
+ else if (entry.local == endpoint && entry.type == MATTER_MULTICAST_BINDING)
{
Binding::Structs::TargetStruct::Type value = {
.node = NullOptional,
@@ -214,7 +214,7 @@ CHIP_ERROR BindingTableAccess::WriteBindingTable(const ConcreteDataAttributePath
{
if (bindingTableIter->local == path.mEndpointId && bindingTableIter->fabricIndex == mAccessingFabricIndex)
{
- if (bindingTableIter->type == EMBER_UNICAST_BINDING)
+ if (bindingTableIter->type == MATTER_UNICAST_BINDING)
{
BindingManager::GetInstance().UnicastBindingRemoved(bindingTableIter.GetIndex());
}
@@ -284,7 +284,7 @@ CHIP_ERROR AddBindingEntry(const EmberBindingTableEntry & entry)
return err;
}
- if (entry.type == EMBER_UNICAST_BINDING)
+ if (entry.type == MATTER_UNICAST_BINDING)
{
err = BindingManager::GetInstance().UnicastBindingCreated(entry.fabricIndex, entry.nodeId);
if (err != CHIP_NO_ERROR)
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/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp
index 941f9d5a5f5842..3e883cf5165e3a 100644
--- a/src/app/clusters/color-control-server/color-control-server.cpp
+++ b/src/app/clusters/color-control-server/color-control-server.cpp
@@ -109,14 +109,14 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy))
{
uint16_t xValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentX::Get(endpoint, &xValue))
+ if (Status::Success != Attributes::CurrentX::Get(endpoint, &xValue))
{
xValue = 0x616B; // Default X value according to spec
}
AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount);
uint16_t yValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentY::Get(endpoint, &yValue))
+ if (Status::Success != Attributes::CurrentY::Get(endpoint, &yValue))
{
yValue = 0x607D; // Default Y value according to spec
}
@@ -133,7 +133,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation))
{
uint8_t saturationValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
+ if (Status::Success != Attributes::CurrentSaturation::Get(endpoint, &saturationValue))
{
saturationValue = 0x00;
}
@@ -143,21 +143,21 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop))
{
uint8_t loopActiveValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
+ if (Status::Success != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue))
{
loopActiveValue = 0x00;
}
AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount);
uint8_t loopDirectionValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
+ if (Status::Success != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue))
{
loopDirectionValue = 0x00;
}
AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount);
uint16_t loopTimeValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
+ if (Status::Success != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue))
{
loopTimeValue = 0x0019; // Default loop time value according to spec
}
@@ -167,7 +167,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl
if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature))
{
uint16_t temperatureValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
+ if (Status::Success != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue))
{
temperatureValue = 0x00FA; // Default temperature value according to spec
}
@@ -175,7 +175,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl
}
uint8_t modeValue;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
+ if (Status::Success != Attributes::EnhancedColorMode::Get(endpoint, &modeValue))
{
modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec
}
@@ -446,7 +446,7 @@ bool ColorControlServer::HasFeature(chip::EndpointId endpoint, Feature feature)
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
@@ -2509,11 +2509,11 @@ Status ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorT
uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint)
{
uint16_t colorTemperatureCoupleToLevelMin;
- EmberAfStatus status;
+ Status status;
status = Attributes::CoupleColorTempToLevelMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
// Not less than the physical min.
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &colorTemperatureCoupleToLevelMin);
@@ -2552,14 +2552,14 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint)
// Initialize startUpColorTempMireds to "maintain previous value" value null
app::DataModel::Nullable startUpColorTemp;
- EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
+ Status status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpColorTemp.IsNull())
+ if (status == Status::Success && !startUpColorTemp.IsNull())
{
uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE;
status = Attributes::ColorTemperatureMireds::Get(endpoint, &updatedColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE;
Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &tempPhysicalMin);
@@ -2576,7 +2576,7 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint)
updatedColorTemp = startUpColorTemp.Value();
status = Attributes::ColorTemperatureMireds::Set(endpoint, updatedColorTemp);
- if (status == EMBER_ZCL_STATUS_SUCCESS)
+ if (status == Status::Success)
{
// Set ColorMode attributes to reflect ColorTemperature.
uint8_t updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature;
@@ -2607,7 +2607,7 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint)
// Check whether our color temperature has actually changed. If not, do
// nothing, and wait for it to change.
uint16_t currentColorTemp;
- if (Attributes::ColorTemperatureMireds::Get(endpoint, ¤tColorTemp) != EMBER_ZCL_STATUS_SUCCESS)
+ if (Attributes::ColorTemperatureMireds::Get(endpoint, ¤tColorTemp) != Status::Success)
{
// Why can't we read our attribute?
return;
@@ -2906,9 +2906,9 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint)
if (colorMode == ColorControl::EnhancedColorMode::kColorTemperature)
{
app::DataModel::Nullable currentLevel;
- EmberAfStatus status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
+ Status status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel);
- if (status != EMBER_ZCL_STATUS_SUCCESS || currentLevel.IsNull())
+ if (status != Status::Success || currentLevel.IsNull())
{
currentLevel.SetNonNull((uint8_t) 0x7F);
}
diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
index 3620379d4ed8e2..7aeb06da661cd1 100644
--- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h
+++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -35,8 +36,6 @@ namespace DeviceEnergyManagement {
using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes;
-using chip::Protocols::InteractionModel::Status;
-
class Delegate
{
public:
@@ -52,7 +51,8 @@ class Delegate
* @param duration The duration that the ESA SHALL maintain the requested power for.
* @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error.
*/
- virtual Status PowerAdjustRequest(const int64_t power, const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status PowerAdjustRequest(const int64_t power, const uint32_t duration,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate SHALL make the ESA end the active power adjustment session & return to normal (or idle) power levels.
@@ -60,7 +60,7 @@ class Delegate
*
* @return It should report SUCCESS if successful and FAILURE otherwise.
*/
- virtual Status CancelPowerAdjustRequest() = 0;
+ virtual Protocols::InteractionModel::Status CancelPowerAdjustRequest() = 0;
/**
* @brief Delegate for the ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastId.
@@ -76,7 +76,8 @@ class Delegate
* @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate
* IM_Status.
*/
- virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTime, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status StartTimeAdjustRequest(const uint32_t requestedStartTime,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for PauseRequest command
@@ -91,7 +92,7 @@ class Delegate
* @param duration Duration that the ESA SHALL be paused for.
* @return Success if the ESA is paused, otherwise returns other IM_Status.
*/
- virtual Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for ResumeRequest command
@@ -102,7 +103,7 @@ class Delegate
*
* @return Success if the ESA is resumed, otherwise returns other IM_Status.
*/
- virtual Status ResumeRequest() = 0;
+ virtual Protocols::InteractionModel::Status ResumeRequest() = 0;
/**
* @brief Delegate handler for ModifyForecastRequest
@@ -118,9 +119,10 @@ class Delegate
* @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command
* SHALL be rejected returning other IM_Status.
*/
- virtual Status ModifyForecastRequest(const uint32_t forecastId,
- const DataModel::DecodableList & slotAdjustments,
- AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status
+ ModifyForecastRequest(const uint32_t forecastId,
+ const DataModel::DecodableList & slotAdjustments,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for RequestConstraintBasedForecast
@@ -133,8 +135,9 @@ class Delegate
* @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within.
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
*/
- virtual Status RequestConstraintBasedForecast(const DataModel::DecodableList & constraints,
- AdjustmentCauseEnum cause) = 0;
+ virtual Protocols::InteractionModel::Status
+ RequestConstraintBasedForecast(const DataModel::DecodableList & constraints,
+ AdjustmentCauseEnum cause) = 0;
/**
* @brief Delegate handler for CancelRequest
@@ -153,7 +156,7 @@ class Delegate
*
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
*/
- virtual Status CancelRequest() = 0;
+ virtual Protocols::InteractionModel::Status CancelRequest() = 0;
// ------------------------------------------------------------------
// Get attribute methods
@@ -210,7 +213,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
void InvokeCommand(HandlerContext & handlerContext) override;
CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override;
- Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
+ Protocols::InteractionModel::Status CheckOptOutAllowsRequest(AdjustmentCauseEnum adjustmentCause);
void HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::PowerAdjustRequest::DecodableType & commandData);
void HandleCancelPowerAdjustRequest(HandlerContext & ctx,
const Commands::CancelPowerAdjustRequest::DecodableType & commandData);
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 73a626e73e4f34..40321f8c53297c 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
@@ -76,67 +76,67 @@ DishwasherAlarmServer & DishwasherAlarmServer::Instance()
return instance;
}
-EmberAfStatus DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask * mask)
+Status DishwasherAlarmServer::GetMaskValue(EndpointId endpoint, BitMask * mask)
{
- EmberAfStatus status = Attributes::Mask::Get(endpoint, mask);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Mask::Get(endpoint, mask);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading mask, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask * latch)
+Status DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask * latch)
{
if (!HasResetFeature(endpoint))
{
ChipLogProgress(Zcl, "Dishwasher Alarm feature: Unsupport Latch attribute");
- return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
+ return Status::UnsupportedAttribute;
}
- EmberAfStatus status = Attributes::Latch::Get(endpoint, latch);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Latch::Get(endpoint, latch);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading latch, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading latch, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask * state)
+Status DishwasherAlarmServer::GetStateValue(EndpointId endpoint, BitMask * state)
{
- EmberAfStatus status = Attributes::State::Get(endpoint, state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::State::Get(endpoint, state);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: get state, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask * supported)
+Status DishwasherAlarmServer::GetSupportedValue(EndpointId endpoint, BitMask * supported)
{
- EmberAfStatus status = Attributes::Supported::Get(endpoint, supported);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Supported::Get(endpoint, supported);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading supported, err:0x%x", to_underlying(status));
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask supported)
+Status DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, const BitMask supported)
{
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
;
- if ((status = Attributes::Supported::Set(endpoint, supported)) != EMBER_ZCL_STATUS_SUCCESS)
+ if ((status = Attributes::Supported::Set(endpoint, supported)) != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing supported, err:0x%x", to_underlying(status));
return status;
}
// Whenever there is change in Supported attribute, Latch should change accordingly (if possible).
BitMask latch;
- if (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS && !supported.HasAll(latch))
+ if (GetLatchValue(endpoint, &latch) == Status::Success && !supported.HasAll(latch))
{
latch = latch & supported;
status = SetLatchValue(endpoint, latch);
@@ -144,7 +144,7 @@ EmberAfStatus DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, cons
// Whenever there is change in Supported attribute, Mask, State should change accordingly.
BitMask mask;
- if ((status = GetMaskValue(endpoint, &mask)) != EMBER_ZCL_STATUS_SUCCESS)
+ if ((status = GetMaskValue(endpoint, &mask)) != Status::Success)
{
return status;
}
@@ -157,26 +157,26 @@ EmberAfStatus DishwasherAlarmServer::SetSupportedValue(EndpointId endpoint, cons
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const BitMask mask)
+Status DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const 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;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
- if ((status = Attributes::Mask::Set(endpoint, mask)) != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Status::Success;
+ if ((status = Attributes::Mask::Set(endpoint, mask)) != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing mask, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing mask, err:0x%x", to_underlying(status));
return status;
}
// Whenever there is change in Mask, State should change accordingly.
BitMask state;
status = GetStateValue(endpoint, &state);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
return status;
}
@@ -189,61 +189,61 @@ EmberAfStatus DishwasherAlarmServer::SetMaskValue(EndpointId endpoint, const Bit
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask latch)
+Status DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask latch)
{
if (!HasResetFeature(endpoint))
{
ChipLogProgress(Zcl, "Dishwasher Alarm feature: Unsupport Latch attribute");
- return EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE;
+ return Status::UnsupportedAttribute;
}
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;
}
- EmberAfStatus status = Attributes::Latch::Set(endpoint, latch);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::Latch::Set(endpoint, latch);
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing latch, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing latch, err:0x%x", to_underlying(status));
return status;
}
return status;
}
-EmberAfStatus DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask newState, bool ignoreLatchState)
+Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask newState, bool ignoreLatchState)
{
BitMask supported;
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;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
BitMask currentState;
status = Attributes::State::Get(endpoint, ¤tState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: reading state, err:0x%x", to_underlying(status));
return status;
}
BitMask latch;
- if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == EMBER_ZCL_STATUS_SUCCESS))
+ if (!ignoreLatchState && (GetLatchValue(endpoint, &latch) == Status::Success))
{
// Restore bits that have their Latch bit set.
auto bitsToKeep = latch & currentState;
@@ -252,9 +252,9 @@ EmberAfStatus DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const Bi
// Store the new value of the State attribute.
status = Attributes::State::Set(endpoint, finalNewState);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing state, err:0x%x", status);
+ ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: writing state, err:0x%x", to_underlying(status));
return status;
}
@@ -268,19 +268,19 @@ EmberAfStatus DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const Bi
return status;
}
-EmberAfStatus DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, const BitMask alarms)
+Status DishwasherAlarmServer::ResetLatchedAlarms(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) != EMBER_ZCL_STATUS_SUCCESS)
+ if (GetStateValue(endpoint, &state) != Status::Success)
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
state.Clear(alarms);
@@ -290,7 +290,7 @@ EmberAfStatus DishwasherAlarmServer::ResetLatchedAlarms(EndpointId endpoint, con
bool DishwasherAlarmServer::HasResetFeature(EndpointId endpoint)
{
uint32_t featureMap = 0;
- if (Attributes::FeatureMap::Get(endpoint, &featureMap) != EMBER_ZCL_STATUS_SUCCESS)
+ if (Attributes::FeatureMap::Get(endpoint, &featureMap) != Status::Success)
{
return false;
}
@@ -319,7 +319,7 @@ static Status ModifyEnabledHandler(const app::ConcreteCommandPath & commandPath,
EndpointId endpoint = commandPath.mEndpointId;
BitMask supported;
- if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().GetSupportedValue(endpoint, &supported) != Status::Success)
{
return Status::Failure;
}
@@ -340,7 +340,7 @@ static Status ModifyEnabledHandler(const app::ConcreteCommandPath & commandPath,
return Status::Failure;
}
// The cluster will do this update if delegate.ModifyEnabledAlarmsCallback() returns true.
- if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().SetMaskValue(endpoint, mask) != Status::Success)
{
return Status::Failure;
}
@@ -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
@@ -366,7 +366,7 @@ static Status ResetHandler(const app::ConcreteCommandPath & commandPath, const B
}
// The cluster will do this update if delegate.ResetAlarmsCallback() returns true.
- if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != EMBER_ZCL_STATUS_SUCCESS)
+ if (DishwasherAlarmServer::Instance().ResetLatchedAlarms(endpoint, alarms) != Status::Success)
{
ChipLogProgress(Zcl, "reset alarms fail");
return Status::Failure;
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
index d03662f29333fd..5aff983ca6e84f 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -35,16 +36,16 @@ class DishwasherAlarmServer
public:
static DishwasherAlarmServer & Instance();
- EmberAfStatus GetMaskValue(EndpointId endpoint, BitMask * mask);
- EmberAfStatus GetStateValue(EndpointId endpoint, BitMask * state);
- EmberAfStatus GetLatchValue(EndpointId endpoint, BitMask * latch);
- EmberAfStatus GetSupportedValue(EndpointId endpoint, BitMask * suppported);
+ Protocols::InteractionModel::Status GetMaskValue(EndpointId endpoint, BitMask * mask);
+ Protocols::InteractionModel::Status GetStateValue(EndpointId endpoint, BitMask * state);
+ Protocols::InteractionModel::Status GetLatchValue(EndpointId endpoint, BitMask * latch);
+ Protocols::InteractionModel::Status GetSupportedValue(EndpointId endpoint, BitMask * suppported);
// Whenever there is change on Mask we should change State accordingly.
- EmberAfStatus SetMaskValue(EndpointId endpoint, const BitMask mask);
- EmberAfStatus SetLatchValue(EndpointId endpoint, const BitMask latch);
+ Protocols::InteractionModel::Status SetMaskValue(EndpointId endpoint, const BitMask mask);
+ Protocols::InteractionModel::Status SetLatchValue(EndpointId endpoint, const BitMask latch);
// A change in supported value will result in a corresponding change in mask and state.
- EmberAfStatus SetSupportedValue(EndpointId endpoint, const BitMask supported);
+ Protocols::InteractionModel::Status SetSupportedValue(EndpointId endpoint, const BitMask supported);
/**
* @brief Set the value of the State attribute
@@ -60,7 +61,8 @@ class DishwasherAlarmServer
* honoring the Mask and Supported attributes.
* The default value for the ignoreLatchState parameter is false.
*/
- EmberAfStatus SetStateValue(EndpointId endpoint, const BitMask newState, bool ignoreLatchState = false);
+ Protocols::InteractionModel::Status SetStateValue(EndpointId endpoint, const BitMask newState,
+ bool ignoreLatchState = false);
/**
* @brief Reset the value of latched alarms in the State attribute.
@@ -69,7 +71,7 @@ class DishwasherAlarmServer
* @param[in] alarms Each bit set to a 1 in this parameter corresponds to a bit in the
* State attribute will SHALL be reset to false.
*/
- EmberAfStatus ResetLatchedAlarms(EndpointId endpoint, const BitMask alarms);
+ Protocols::InteractionModel::Status ResetLatchedAlarms(EndpointId endpoint, const BitMask alarms);
// check whether the Alarm featureMap has enabled Reset feature.
bool HasResetFeature(EndpointId endpoint);
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 8f1037ac3fba17..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;
}
- EmberAfStatus status = EMBER_ZCL_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 = EMBER_ZCL_STATUS_INVALID_COMMAND;
+ status = ClusterStatusCode(Status::InvalidCommand);
ChipLogProgress(Zcl, "[SetUser] Invalid operation type [endpointId=%d,operationType=%u]", commandPath.mEndpointId,
to_underlying(operationType));
break;
@@ -1873,25 +1874,25 @@ bool DoorLockServer::findUserIndexByCredential(chip::EndpointId endpointId, Cred
return false;
}
-EmberAfStatus 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 EMBER_ZCL_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);
- return static_cast(DlStatus::kOccupied);
+ return ClusterStatusCode::ClusterSpecificFailure(DlStatus::kOccupied);
}
const auto & newUserName = !userName.IsNull() ? userName.Value() : ""_span;
@@ -1917,7 +1918,7 @@ EmberAfStatus DoorLockServer::createUser(chip::EndpointId endpointId, chip::Fabr
endpointId, creatorFabricIdx, userIndex, static_cast(newUserName.size()), newUserName.data(),
newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule),
static_cast(newTotalCredentials));
- return EMBER_ZCL_STATUS_FAILURE;
+ return ClusterStatusCode(Status::Failure);
}
ChipLogProgress(Zcl,
@@ -1931,28 +1932,27 @@ EmberAfStatus DoorLockServer::createUser(chip::EndpointId endpointId, chip::Fabr
sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kAdd, sourceNodeId, creatorFabricIdx,
userIndex, userIndex);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return ClusterStatusCode(Status::Success);
}
-EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex,
- chip::NodeId sourceNodeId, uint16_t userIndex, const Nullable & userName,
- const Nullable & userUniqueId, const Nullable & userStatus,
- const Nullable & userType,
- const Nullable & credentialRule)
+Status DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
+ uint16_t userIndex, const Nullable & userName,
+ const Nullable & userUniqueId, const Nullable & userStatus,
+ const Nullable & userType, const Nullable & credentialRule)
{
// We should get the user by that index first
EmberAfPluginDoorLockUserInfo user;
if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
{
ChipLogError(Zcl, "[modifyUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
// appclusters, 5.2.4.34: to modify user its status should NOT be set to Available. If it is we should return INVALID_COMMAND.
if (UserStatusEnum::kAvailable == user.userStatus)
{
ChipLogProgress(Zcl, "[modifyUser] Unable to modify non-existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
// appclusters, 5.2.4.34: UserName SHALL be null if modifying a user record that was not created by the accessing fabric
@@ -1962,7 +1962,7 @@ EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::Fabr
"[modifyUser] Unable to modify name of user created by different fabric "
"[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
endpointId, userIndex, user.createdBy, modifierFabricIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
// appclusters, 5.2.4.34: UserUniqueID SHALL be null if modifying the user record that was not created by the accessing fabric.
@@ -1972,7 +1972,7 @@ EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::Fabr
"[modifyUser] Unable to modify UUID of user created by different fabric "
"[endpointId=%d,userIndex=%d,creatorIdx=%d,modifierIdx=%d]",
endpointId, userIndex, user.createdBy, modifierFabricIndex);
- return EMBER_ZCL_STATUS_INVALID_COMMAND;
+ return Status::InvalidCommand;
}
const auto & newUserName = !userName.IsNull() ? userName.Value() : user.userName;
@@ -1991,7 +1991,7 @@ EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::Fabr
",userType=%u,credentialRule=%u]",
endpointId, modifierFabricIndex, userIndex, static_cast(newUserName.size()), newUserName.data(),
newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule));
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
ChipLogProgress(Zcl,
@@ -2004,7 +2004,7 @@ EmberAfStatus DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::Fabr
sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kModify, sourceNodeId,
modifierFabricIndex, userIndex, userIndex);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
Status DoorLockServer::clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId, 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,
- EmberAfStatus 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
@@ -3627,10 +3628,10 @@ void DoorLockServer::SendEvent(chip::EndpointId endpointId, T & event)
template
bool DoorLockServer::GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
+ Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const
{
- EmberAfStatus status = getFn(endpointId, &value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = getFn(endpointId, &value);
+ bool success = (Status::Success == status);
if (!success)
{
@@ -3642,10 +3643,10 @@ bool DoorLockServer::GetAttribute(chip::EndpointId endpointId, chip::AttributeId
template
bool DoorLockServer::SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value)
+ Status (*setFn)(chip::EndpointId endpointId, T value), T value)
{
- EmberAfStatus status = setFn(endpointId, value);
- bool success = (EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = setFn(endpointId, value);
+ bool success = (Status::Success == status);
if (!success)
{
@@ -3951,13 +3952,13 @@ void DoorLockServer::setAliroReaderConfigCommandHandler(CommandHandler * command
return;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
if (!emberAfPluginDoorLockSetAliroReaderConfig(endpointID, signingKey, verificationKey, groupIdentifier, groupResolvingKey))
{
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
- status = EMBER_ZCL_STATUS_FAILURE;
+ status = Status::Failure;
}
- sendClusterResponse(commandObj, commandPath, status);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(status));
}
void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath)
@@ -3973,13 +3974,13 @@ void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * comma
return;
}
- EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
+ Status status = Status::Success;
if (!emberAfPluginDoorLockClearAliroReaderConfig(endpointID))
{
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
- status = EMBER_ZCL_STATUS_FAILURE;
+ 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 9b1a7f6fd27791..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,15 +307,17 @@ class DoorLockServer : public chip::app::AttributeAccessInterface
bool findUserIndexByCredential(chip::EndpointId endpointId, CredentialTypeEnum credentialType, chip::ByteSpan credentialData,
uint16_t & userIndex, uint16_t & credentialIndex, EmberAfPluginDoorLockUserInfo & userInfo);
- EmberAfStatus 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 = Nullable());
- EmberAfStatus modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
- uint16_t userIndex, const Nullable & userName, const Nullable & userUniqueId,
- const Nullable & userStatus, const Nullable & userType,
- const Nullable & credentialRule);
+ 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,
+ const Nullable & credentialRule,
+ const Nullable & credential = Nullable());
+ chip::Protocols::InteractionModel::Status
+ modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId, uint16_t userIndex,
+ const Nullable & userName, const Nullable & userUniqueId,
+ const Nullable & userStatus, const Nullable & userType,
+ const Nullable & credentialRule);
chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
chip::NodeId sourceNodeId, uint16_t userIndex, bool sendUserChangeEvent);
chip::Protocols::InteractionModel::Status clearUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricId,
@@ -477,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,
- EmberAfStatus status);
+ chip::Protocols::InteractionModel::ClusterStatusCode status);
/**
* @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands
@@ -544,7 +546,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface
*/
template
bool GetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
+ chip::Protocols::InteractionModel::Status (*getFn)(chip::EndpointId endpointId, T * value), T & value) const;
/**
* @brief Set generic attribute value
@@ -559,7 +561,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface
*/
template
bool SetAttribute(chip::EndpointId endpointId, chip::AttributeId attributeId,
- EmberAfStatus (*setFn)(chip::EndpointId endpointId, T value), T value);
+ chip::Protocols::InteractionModel::Status (*setFn)(chip::EndpointId endpointId, T value), T value);
// AttributeAccessInterface's Read API
CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override;
diff --git a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
index 0b5d45f1dc447b..28af3fa0abb343 100644
--- a/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
+++ b/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -31,8 +32,6 @@ namespace ElectricalPowerMeasurement {
using namespace chip::app::Clusters::ElectricalPowerMeasurement::Attributes;
using namespace chip::app::Clusters::ElectricalPowerMeasurement::Structs;
-using chip::Protocols::InteractionModel::Status;
-
class Delegate
{
public:
diff --git a/src/app/clusters/energy-evse-server/energy-evse-server.h b/src/app/clusters/energy-evse-server/energy-evse-server.h
index dfead37517d4e8..2ff46f339ff6ad 100644
--- a/src/app/clusters/energy-evse-server/energy-evse-server.h
+++ b/src/app/clusters/energy-evse-server/energy-evse-server.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -38,7 +39,6 @@ constexpr int64_t kMinimumChargeCurrent = 0;
constexpr int64_t kMaximumChargeCurrent = 80000;
constexpr uint32_t kMaxRandomizationDelayWindow = 86400;
-using chip::Protocols::InteractionModel::Status;
/** @brief
* Defines methods for implementing application-specific logic for the EVSE Management Cluster.
*/
@@ -55,30 +55,31 @@ class Delegate
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status Disable() = 0;
+ virtual Protocols::InteractionModel::Status Disable() = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Charging.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status EnableCharging(const DataModel::Nullable & enableChargeTime, const int64_t & minimumChargeCurrent,
- const int64_t & maximumChargeCurrent) = 0;
+ virtual Protocols::InteractionModel::Status EnableCharging(const DataModel::Nullable & enableChargeTime,
+ const int64_t & minimumChargeCurrent,
+ const int64_t & maximumChargeCurrent) = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Discharging.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status EnableDischarging(const DataModel::Nullable & enableDischargeTime,
- const int64_t & maximumDischargeCurrent) = 0;
+ virtual Protocols::InteractionModel::Status EnableDischarging(const DataModel::Nullable & enableDischargeTime,
+ const int64_t & maximumDischargeCurrent) = 0;
/**
* @brief Delegate should implement a handler to enable EVSE Diagnostics.
* It should report Status::Success if successful and may
* return other Status codes if it fails
*/
- virtual Status StartDiagnostics() = 0;
+ virtual Protocols::InteractionModel::Status StartDiagnostics() = 0;
// ------------------------------------------------------------------
// Get attribute methods
diff --git a/src/app/clusters/fan-control-server/fan-control-server.cpp b/src/app/clusters/fan-control-server/fan-control-server.cpp
index 8bca0d1e86c129..b297acdd1e80cf 100644
--- a/src/app/clusters/fan-control-server/fan-control-server.cpp
+++ b/src/app/clusters/fan-control-server/fan-control-server.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
using namespace chip;
using namespace chip::app;
@@ -41,6 +42,8 @@ using namespace chip::app::Clusters;
using namespace chip::app::Clusters::FanControl;
using namespace chip::app::Clusters::FanControl::Attributes;
+using Protocols::InteractionModel::Status;
+
namespace {
constexpr size_t kFanControlDelegateTableSize =
@@ -85,11 +88,11 @@ namespace {
// Indicates if the write operation is from the cluster server itself
bool gWriteFromClusterLogic = false;
-EmberAfStatus SetFanModeToOff(EndpointId endpointId)
+Status SetFanModeToOff(EndpointId endpointId)
{
FanModeEnum currentFanMode;
- EmberAfStatus status = FanMode::Get(endpointId, ¤tFanMode);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status);
+ Status status = FanMode::Get(endpointId, ¤tFanMode);
+ VerifyOrReturnError(Status::Success == status, status);
if (currentFanMode != FanModeEnum::kOff)
{
@@ -103,7 +106,7 @@ bool HasFeature(EndpointId endpoint, Feature feature)
{
bool success;
uint32_t featureMap;
- success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ success = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
}
@@ -163,8 +166,8 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
else if (*value == to_underlying(FanModeEnum::kSmart))
{
FanModeSequenceEnum fanModeSequence;
- EmberAfStatus status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::Failure);
+ Status status = FanModeSequence::Get(attributePath.mEndpointId, &fanModeSequence);
+ VerifyOrReturnError(Status::Success == status, Status::Failure);
if (SupportsAuto(attributePath.mEndpointId) &&
((fanModeSequence == FanModeSequenceEnum::kOffLowHighAuto) ||
@@ -204,8 +207,8 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
else
{
uint8_t speedMax;
- EmberAfStatus status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
if (*value <= speedMax)
{
@@ -247,8 +250,8 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
if (SupportsRocking(attributePath.mEndpointId))
{
BitMask rockSupport;
- EmberAfStatus status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = RockSupport::Get(attributePath.mEndpointId, &rockSupport);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
auto rawRockSupport = rockSupport.Raw();
if ((*value & rawRockSupport) == *value)
{
@@ -269,8 +272,8 @@ MatterFanControlClusterServerPreAttributeChangedCallback(const ConcreteAttribute
if (SupportsWind(attributePath.mEndpointId))
{
BitMask windSupport;
- EmberAfStatus status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::ConstraintError);
+ Status status = WindSupport::Get(attributePath.mEndpointId, &windSupport);
+ VerifyOrReturnError(Status::Success == status, Status::ConstraintError);
auto rawWindSupport = windSupport.Raw();
if ((*value & rawWindSupport) == *value)
{
@@ -312,30 +315,30 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
{
case FanMode::Id: {
FanModeEnum mode;
- EmberAfStatus status = FanMode::Get(attributePath.mEndpointId, &mode);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status);
+ Status status = FanMode::Get(attributePath.mEndpointId, &mode);
+ VerifyOrReturn(Status::Success == status);
// Setting the FanMode value to Off SHALL set the values of PercentSetting, PercentCurrent,
// SpeedSetting, SpeedCurrent attributes to 0 (zero).
if (mode == FanModeEnum::kOff)
{
status = PercentSetting::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
status = PercentCurrent::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentCurrent with error: 0x%02x", to_underlying(status)));
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
status = SpeedSetting::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
status = SpeedCurrent::Set(attributePath.mEndpointId, 0);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedCurrent with error: 0x%02x", to_underlying(status)));
}
}
@@ -345,30 +348,30 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
{
gWriteFromClusterLogic = true;
status = PercentSetting::SetNull(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write PercentSetting with error: 0x%02x", to_underlying(status)));
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
gWriteFromClusterLogic = true;
status = SpeedSetting::SetNull(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to write SpeedSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
}
case PercentSetting::Id: {
DataModel::Nullable percentSetting;
- EmberAfStatus status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !percentSetting.IsNull());
+ Status status = PercentSetting::Get(attributePath.mEndpointId, percentSetting);
+ VerifyOrReturn(Status::Success == status && !percentSetting.IsNull());
// If PercentSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
if (percentSetting.Value() == 0)
{
status = SetFanModeToOff(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
}
if (SupportsMultiSpeed(attributePath.mEndpointId))
@@ -377,13 +380,13 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
// speed = ceil( SpeedMax * (percent * 0.01) )
uint8_t speedMax;
status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
DataModel::Nullable currentSpeedSetting;
status = SpeedSetting::Get(attributePath.mEndpointId, currentSpeedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedSetting with error: 0x%02x", to_underlying(status)));
uint16_t percent = percentSetting.Value();
// Plus 99 then integer divide by 100 instead of multiplying 0.01 to avoid floating point precision error
@@ -392,8 +395,8 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
if (currentSpeedSetting.IsNull() || speedSetting != currentSpeedSetting.Value())
{
status = SpeedSetting::Set(attributePath.mEndpointId, speedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set SpeedSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
@@ -402,28 +405,28 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
if (SupportsMultiSpeed(attributePath.mEndpointId))
{
DataModel::Nullable speedSetting;
- EmberAfStatus status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status && !speedSetting.IsNull());
+ Status status = SpeedSetting::Get(attributePath.mEndpointId, speedSetting);
+ VerifyOrReturn(Status::Success == status && !speedSetting.IsNull());
// If SpeedSetting is set to 0, the server SHALL set the FanMode attribute value to Off.
if (speedSetting.Value() == 0)
{
status = SetFanModeToOff(attributePath.mEndpointId);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set FanMode to off with error: 0x%02x", to_underlying(status)));
}
// Adjust PercentSetting from a speed value change for SpeedSetting
// percent = floor( speed/SpeedMax * 100 )
uint8_t speedMax;
status = SpeedMax::Get(attributePath.mEndpointId, &speedMax);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get SpeedMax with error: 0x%02x", to_underlying(status)));
DataModel::Nullable currentPercentSetting;
status = PercentSetting::Get(attributePath.mEndpointId, currentPercentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to get PercentSetting with error: 0x%02x", to_underlying(status)));
float speed = speedSetting.Value();
Percent percentSetting = static_cast(speed / speedMax * 100);
@@ -431,8 +434,8 @@ void MatterFanControlClusterServerAttributeChangedCallback(const app::ConcreteAt
if (currentPercentSetting.IsNull() || percentSetting != currentPercentSetting.Value())
{
status = PercentSetting::Set(attributePath.mEndpointId, percentSetting);
- VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status,
- ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", status));
+ VerifyOrReturn(Status::Success == status,
+ ChipLogError(Zcl, "Failed to set PercentSetting with error: 0x%02x", to_underlying(status)));
}
}
break;
diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp
index d591c3f3d6e331..65bfbc1c3e5952 100644
--- a/src/app/clusters/groups-server/groups-server.cpp
+++ b/src/app/clusters/groups-server/groups-server.cpp
@@ -102,40 +102,40 @@ static Status GroupAdd(FabricIndex fabricIndex, EndpointId endpointId, GroupId g
return Status::ResourceExhausted;
}
-static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
+static Status GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, GroupId groupId)
{
- VerifyOrReturnError(IsValidGroupId(groupId), EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
- VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrReturnError(IsValidGroupId(groupId), Status::ConstraintError);
+ VerifyOrReturnError(GroupExists(fabricIndex, endpointId, groupId), Status::NotFound);
GroupDataProvider * provider = GetGroupDataProvider();
- VerifyOrReturnError(nullptr != provider, EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrReturnError(nullptr != provider, Status::NotFound);
CHIP_ERROR err = provider->RemoveEndpoint(fabricIndex, groupId, endpointId);
if (CHIP_NO_ERROR == err)
{
MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id,
GroupKeyManagement::Attributes::GroupTable::Id);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return Status::Success;
}
ChipLogDetail(Zcl, "ERR: Failed to remove mapping (end:%d, group:0x%x), err:%" CHIP_ERROR_FORMAT, endpointId, groupId,
err.Format());
- return EMBER_ZCL_STATUS_NOT_FOUND;
+ return Status::NotFound;
}
void emberAfGroupsClusterServerInitCallback(EndpointId endpointId)
{
// According to spec, highest bit (Group Names) MUST match feature bit 0 (Group Names)
- EmberAfStatus status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ Status status = Attributes::NameSupport::Set(endpointId, NameSupportBitmap::kGroupNames);
+ if (status != Status::Success)
{
- ChipLogDetail(Zcl, "ERR: writing NameSupport %x", status);
+ ChipLogDetail(Zcl, "ERR: writing NameSupport %x", to_underlying(status));
}
status = Attributes::FeatureMap::Set(endpointId, static_cast(Feature::kGroupNames));
- if (status != EMBER_ZCL_STATUS_SUCCESS)
+ if (status != Status::Success)
{
- ChipLogDetail(Zcl, "ERR: writing group feature map %x", status);
+ ChipLogDetail(Zcl, "ERR: writing group feature map %x", to_underlying(status));
}
}
@@ -161,21 +161,21 @@ bool emberAfGroupsClusterViewGroupCallback(app::CommandHandler * commandObj, con
GroupDataProvider * provider = GetGroupDataProvider();
GroupDataProvider::GroupInfo info;
Groups::Commands::ViewGroupResponse::Type response;
- CHIP_ERROR err = CHIP_NO_ERROR;
- EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND;
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ Status status = Status::NotFound;
- VerifyOrExit(IsValidGroupId(groupId), status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
- VerifyOrExit(nullptr != provider, status = EMBER_ZCL_STATUS_FAILURE);
- VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrExit(IsValidGroupId(groupId), status = Status::ConstraintError);
+ VerifyOrExit(nullptr != provider, status = Status::Failure);
+ VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = Status::NotFound);
err = provider->GetGroupInfo(fabricIndex, groupId, info);
- VerifyOrExit(CHIP_NO_ERROR == err, status = EMBER_ZCL_STATUS_NOT_FOUND);
+ VerifyOrExit(CHIP_NO_ERROR == err, status = Status::NotFound);
response.groupName = CharSpan(info.name, strnlen(info.name, GroupDataProvider::GroupInfo::kGroupNameMax));
- status = EMBER_ZCL_STATUS_SUCCESS;
+ status = Status::Success;
exit:
response.groupID = groupId;
- response.status = status;
+ response.status = to_underlying(status);
commandObj->AddResponse(commandPath, response);
return true;
}
@@ -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 90953e3b814dd2..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
@@ -36,6 +35,8 @@ using namespace chip::app::Clusters::IcdManagement;
using namespace Protocols;
using namespace chip::Access;
+using chip::Protocols::InteractionModel::Status;
+
namespace {
/**
@@ -49,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;
}
@@ -61,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);
@@ -68,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)
@@ -86,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);
@@ -94,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;
@@ -114,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();
@@ -157,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
*
@@ -214,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)
{
@@ -333,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
@@ -341,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;
}
@@ -358,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)
*
@@ -396,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)
@@ -413,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 308d50859d2d4b..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,18 +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:
@@ -39,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
*
@@ -46,23 +58,31 @@ class ICDManagementServer
* ICDConfigurationData If function fails, icdCounter will be unchanged
* @return Status
*/
- Status RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
- uint32_t & icdCounter);
+ chip::Protocols::InteractionModel::Status
+ RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData,
+ uint32_t & icdCounter);
- Status UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
+ 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
- Status StayActiveRequest(chip::FabricIndex fabricIndex);
+ 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/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
index c3107015ca6f0c..7a3d47f823c409 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
@@ -82,12 +82,12 @@ LaundryDryerControlsServer & LaundryDryerControlsServer::Instance()
return sInstance;
}
-EmberAfStatus LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
+Status LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId endpointId, DrynessLevelEnum newSelectedDrynessLevel)
{
DataModel::Nullable selectedDrynessLevel;
- EmberAfStatus res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
+ Status res = SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
- if ((res == EMBER_ZCL_STATUS_SUCCESS) && (selectedDrynessLevel != newSelectedDrynessLevel))
+ if ((res == Status::Success) && (selectedDrynessLevel != newSelectedDrynessLevel))
{
res = SelectedDrynessLevel::Set(endpointId, newSelectedDrynessLevel);
}
@@ -95,8 +95,8 @@ EmberAfStatus LaundryDryerControlsServer::SetSelectedDrynessLevel(EndpointId end
return res;
}
-EmberAfStatus LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
- DataModel::Nullable & selectedDrynessLevel)
+Status LaundryDryerControlsServer::GetSelectedDrynessLevel(EndpointId endpointId,
+ DataModel::Nullable & selectedDrynessLevel)
{
return SelectedDrynessLevel::Get(endpointId, selectedDrynessLevel);
}
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
index 454c029e21fc52..5a7123c0ee78e0 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
@@ -21,6 +21,7 @@
#include
#include