diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e80dfa78bded48..ce44f93caadcea 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "BUILD_VERSION": "0.5.79" + "BUILD_VERSION": "0.5.84" } }, "remoteUser": "vscode", diff --git a/.github/labeler.yml b/.github/labeler.yml index 6e52598d8782b7..e3106f8ab57d01 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -51,6 +51,9 @@ gn: - "*.gn" - "*.gni" +tests: + - src/app/tests/* + github: - .github diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index f7a59c578317e5..3e6e6856a8c0ce 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 steps: - uses: Wandalen/wretry.action@v1.0.15 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 82d8c50458d78f..5f9e3b8e8da158 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -128,7 +128,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -279,7 +279,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index a11e2786477b52..7a3e9f86bd7946 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -30,7 +30,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 options: --user root steps: @@ -42,6 +42,11 @@ jobs: token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform linux + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh - name: CI Examples Linux shell: bash run: | @@ -53,7 +58,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.5.79 + image: connectedhomeip/chip-build-esp32:0.5.84 options: --user root steps: @@ -65,6 +70,11 @@ jobs: token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform esp32 + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh - name: CI Examples ESP32 shell: bash run: | @@ -76,7 +86,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.5.79 + image: connectedhomeip/chip-build-nrf-platform:0.5.84 options: --user root steps: @@ -88,6 +98,11 @@ jobs: token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform nrfconnect + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh - name: CI Examples NRFConnect shell: bash run: | diff --git a/.github/workflows/cherry-picks.yaml b/.github/workflows/cherry-picks.yaml index ac113172aa4748..64a5341fa973f6 100644 --- a/.github/workflows/cherry-picks.yaml +++ b/.github/workflows/cherry-picks.yaml @@ -21,6 +21,7 @@ jobs: || (contains(github.event.pull_request.labels.*.name, 'android')) || (contains(github.event.pull_request.labels.*.name, 'examples')) || (contains(github.event.pull_request.labels.*.name, 'scripts')) + || (contains(github.event.pull_request.labels.*.name, 'tests')) || (contains(github.event.pull_request.labels.*.name, 'workflows')) || (contains(github.event.pull_request.labels.*.name, 'github')) || (contains(github.event.pull_request.labels.*.name, 'sve cherry-pick')) diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index a14b460375db55..e867790820231a 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -38,7 +38,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: - # image: connectedhomeip/chip-build-cirque:0.5.79 + # image: connectedhomeip/chip-build-cirque:0.5.84 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index 026071e76a9e48..2ddb2d4cac5595 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -82,42 +82,23 @@ jobs: - name: Delete Defaults run: defaults delete com.apple.dt.xctest.tool continue-on-error: true - - name: Run macOS Build - timeout-minutes: 40 - # Enable -Werror by hand here, because the Xcode config can't - # enable it for various reasons. Keep whatever Xcode settings - # for OTHER_CFLAGS exist by using ${inherited}. - # - # Disable -Wmacro-redefined because CHIP_DEVICE_CONFIG_ENABLE_MDNS - # seems to be unconditionally defined in CHIPDeviceBuildConfig.h, - # which is apparently being included after CHIPDeviceConfig.h. - run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-macro-redefined' - working-directory: src/darwin/Framework - - name: Copying Framework to Temporary Path - continue-on-error: true + - name: Build Apps + timeout-minutes: 75 run: | - mkdir -p /tmp/macos_framework_output - ls -la /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/ - mv /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/Matter.framework /tmp/macos_framework_output - ls -la /tmp/macos_framework_output - # Disabling for now - # - # - name: Build Apps - # timeout-minutes: 60 - # run: | - # ./scripts/run_in_build_env.sh \ - # "./scripts/build/build_examples.py \ - # --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \ - # --target darwin-x64-all-clusters-${BUILD_VARIANT} \ - # --target darwin-x64-lock-${BUILD_VARIANT} \ - # --target darwin-x64-ota-provider-${BUILD_VARIANT} \ - # --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ - # --target darwin-x64-tv-app-${BUILD_VARIANT} \ - # build \ - # --copy-artifacts-to objdir-clone \ - # " + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \ + --target darwin-x64-all-clusters-${BUILD_VARIANT} \ + --target darwin-x64-lock-${BUILD_VARIANT} \ + --target darwin-x64-ota-provider-${BUILD_VARIANT} \ + --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ + --target darwin-x64-tv-app-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " + # Disable for now # - name: Run Tests - # timeout-minutes: 60 + # timeout-minutes: 65 # run: | # ./scripts/run_in_build_env.sh \ # "./scripts/tests/run_test_suite.py \ diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index f1c87eb9314547..7011285bf64dc4 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -88,21 +88,9 @@ jobs: # which is apparently being included after CHIPDeviceConfig.h. run: xcodebuild -target "Matter" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-macro-redefined' working-directory: src/darwin/Framework - - name: Copying Framework to Temporary Path - continue-on-error: true - run: | - mkdir -p /tmp/macos_framework_output - ls -la /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/ - mv /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/build/Release/Matter.framework /tmp/macos_framework_output - ls -la /tmp/macos_framework_output - name: Clean Build run: xcodebuild clean working-directory: src/darwin/Framework - # Disabling for now - # - name: Build example darwin-framework-tool - # timeout-minutes: 15 - # run: | - # scripts/examples/gn_build_example.sh examples/darwin-framework-tool out/debug chip_config_network_layer_ble=false is_asan=true - name: Build example All Clusters Server timeout-minutes: 15 run: | diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index a9b503ac0f4835..ec6cb8671a44af 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build-doxygen:0.5.79 + image: connectedhomeip/chip-build-doxygen:0.5.84 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index b52f0c998157e3..08e8a0a46bac75 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.5.79 + image: connectedhomeip/chip-build-ameba:0.5.84 options: --user root steps: diff --git a/.github/workflows/examples-bl602.yaml b/.github/workflows/examples-bl602.yaml new file mode 100644 index 00000000000000..56166d9e667756 --- /dev/null +++ b/.github/workflows/examples-bl602.yaml @@ -0,0 +1,79 @@ +# Copyright (c) 2020 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 - BL602 + +on: + push: + pull_request: + +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 + +jobs: + bl602: + name: BL602 + timeout-minutes: 90 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build:latest + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - uses: Wandalen/wretry.action@v1.0.15 + name: Checkout + with: + action: actions/checkout@v3 + with: | + token: ${{ github.token }} + attempt_limit: 3 + attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform bl602 + + - name: Set up environment for size reports + if: ${{ !env.ACT }} + env: + GH_CONTEXT: ${{ toJson(github) }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Build example BL602 Lighting App + timeout-minutes: 30 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target bl602-light build" + + - name: Get Lighting size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602 lighting-app \ + out/bl602-light/chip-bl602-lighting-example.out /tmp/bloat_reports/ + + - name: Build example BL602 Lighting App with RPCs + timeout-minutes: 30 + run: | + scripts/examples/gn_bl602_example.sh lighting-app ./out/bl602-light-rpc 'import("//with_pw_rpc.gni")' + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602+rpc lighting-app \ + out/bl602-light-rpc/chip-bl602-lighting-example.out /tmp/bloat_reports/ + + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,BL602-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index 4c7b67c2c9bb77..3e9612c5823a0a 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ti:0.5.79 + image: connectedhomeip/chip-build-ti:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 2324317338fe8c..2fa6e21cc2273d 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-efr32:0.5.79 + image: connectedhomeip/chip-build-efr32:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 7751329753370a..469ec1e9088df9 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.5.79 + image: connectedhomeip/chip-build-esp32:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -118,7 +118,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.5.79 + image: connectedhomeip/chip-build-esp32:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index e9d038863669c8..bb2aea6a47e8b5 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-infineon:0.5.79 + image: connectedhomeip/chip-build-infineon:0.5.84 steps: - uses: Wandalen/wretry.action@v1.0.15 diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 3518ae8ea99339..9885e1e43788b6 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-k32w:0.5.79 + image: connectedhomeip/chip-build-k32w:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index d86f9937f2c76d..d8509480619562 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-crosscompile:0.5.79 + image: connectedhomeip/chip-build-crosscompile:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 2236761bc264ea..47c2657fb8f9e5 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-imx:0.5.79 + image: connectedhomeip/chip-build-imx:0.5.85 steps: - uses: Wandalen/wretry.action@v1.0.15 diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 7312b61daccdaf..6aefd6d6e4a4ff 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 15c12fd4f0f576..5facc4ae1d6bba 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-mbed-os:0.5.79 + image: connectedhomeip/chip-build-mbed-os:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 7d9824a8db0dfa..0e2c7f4c4f0090 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.5.79 + image: connectedhomeip/chip-build-nrf-platform:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index d772919707d131..b903c0d1d1ba66 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 1089f0a31af578..c74de0749c66ed 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-telink:0.5.79 + image: connectedhomeip/chip-build-telink:0.5.84 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 68186bfefd1d69..802ffb0ec45d53 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-tizen:0.5.81 + image: connectedhomeip/chip-build-tizen:0.5.84 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -49,5 +49,5 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform tizen - - name: Build example Tizen lighting app + - name: Build Tizen examples run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'tizen-*' build" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index e2cb8a68c607d6..64f948db3973b1 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.5.79 + image: connectedhomeip/chip-build-android:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 4fbead5e450e4d..70f3a88f8fcc5a 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 9374bb6ee0b7e0..30e70d95ec452d 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32-qemu:0.5.79 + image: connectedhomeip/chip-build-esp32-qemu:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 199b2bc7543942..60c4cc1454c128 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.5.79 + image: connectedhomeip/chip-build-esp32:0.5.84 steps: - uses: Wandalen/wretry.action@v1.0.15 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-efr32:0.5.79 + image: connectedhomeip/chip-build-efr32:0.5.84 steps: - uses: Wandalen/wretry.action@v1.0.15 name: Checkout diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 239f32fd7ff562..aae77701773fd1 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.5.79 + image: connectedhomeip/chip-build-android:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 351d50ed7e32e0..08a23cb1c4b73c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -239,7 +239,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 99a9398363f011..c3f8d9224aedc0 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.79 + image: connectedhomeip/chip-build:0.5.84 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index ebd49b363048a6..0f8a3bf232dc19 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build-zap:0.5.79 + image: connectedhomeip/chip-build-zap:0.5.84 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 56355d7e351324..6d1b2f2e59682a 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build-zap:0.5.79 + image: connectedhomeip/chip-build-zap:0.5.84 defaults: run: shell: sh diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 92d88e95112fa6..70edc0c7087865 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -236,11 +236,6 @@ if (CONFIG_CHIP_ENABLE_DNSSD_SRP) chip_gn_arg_string("chip_mdns" "platform") endif() -if (CONFIG_CHIP_FIRMWARE_BUILD_UNIX_TIME) - string(TIMESTAMP CHIP_FIRMWARE_BUILD_UNIX_TIME "%s") - chip_gn_arg_string("chip_device_config_firmware_build_unix_time" ${CHIP_FIRMWARE_BUILD_UNIX_TIME}) -endif() - if (CHIP_PROJECT_CONFIG) chip_gn_arg_string("chip_project_config_include" ${CHIP_PROJECT_CONFIG}) chip_gn_arg_string("chip_system_project_config_include" ${CHIP_PROJECT_CONFIG}) diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 2fe7f24571eaff..6550dca841b51e 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -254,4 +254,24 @@ config CHIP_DEVICE_ROTATING_DEVICE_UID A device rotating id unique id which will be generated if this config is not set in prj.conf file. +config CHIP_CERTIFICATION_DECLARATION_STORAGE + bool "Enable storing Certification Declaration" + depends on CHIP_FACTORY_DATA + help + Enables storing Certification Declaration in Zephyr settings + instead of using hardcoded value from firmware. It also adds + support for including new Certification Declaration into a firmware + update image package sent via OTA Software Update. + +if CHIP_CERTIFICATION_DECLARATION_STORAGE + +config CHIP_CERTIFiCATION_DECLARATION_OTA_IMAGE_ID + int "Certification declaration OTA image id" + default 205 #0xcd + help + The image id of Certification Declaration image + for sending it via OTA Software Update purposes. + +endif + endif diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index b197f0491a9689..b17cb0780a4bec 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -229,13 +229,6 @@ config CHIP_MALLOC_SYS_HEAP_SIZE endif -config CHIP_FIRMWARE_BUILD_UNIX_TIME - bool "Make Unix time of compilation available in source code" - default y - help - When enabled, the Unix time of the firmware build is exposed to the - source code and used to initialize the last known UTC time. - config APP_LINK_WITH_CHIP bool "Link 'app' with Connected Home over IP" default y diff --git a/credentials/development/fetch-development-paa-certs-from-dcl.py b/credentials/development/fetch-development-paa-certs-from-dcl.py index 7ac67b275c220f..9eb530de3d1bfd 100644 --- a/credentials/development/fetch-development-paa-certs-from-dcl.py +++ b/credentials/development/fetch-development-paa-certs-from-dcl.py @@ -41,14 +41,18 @@ def parse_paa_root_certs(cmdpipe, paa_list): example output of a query to all x509 root certs in DCL: certs: - - subject: CN=Non Production ONLY - XFN PAA Class 3 - subject_key_id: F8:99:A9:D5:AD:71:71:E4:C3:81:7F:14:10:7F:78:F0:D9:F7:62:E9 - - subject: CN=Matter Development PAA - subject_key_id: FA:92:CF:9:5E:FA:42:E1:14:30:65:16:32:FE:FE:1B:2C:77:A7:C8 - - subject: CN=Matter PAA 1,O=Google,C=US,1.3.6.1.4.1.37244.2.1=#130436303036 - subject_key_id: B0:0:56:81:B8:88:62:89:62:80:E1:21:18:A1:A8:BE:9:DE:93:21 - - subject: CN=Matter Test PAA,1.3.6.1.4.1.37244.2.1=#130431323544 - subject_key_id: E2:90:8D:36:9C:3C:A3:C1:13:BB:9:E2:4D:C1:CC:C5:A6:66:91:D4 + - subject: MCExHzAdBgNVBAMMFk1hdHRlciBEZXZlbG9wbWVudCBQQUE= + subjectKeyId: FA:92:CF:09:5E:FA:42:E1:14:30:65:16:32:FE:FE:1B:2C:77:A7:C8 + - subject: MDAxGDAWBgNVBAMMD01hdHRlciBUZXN0IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDEyNUQ= + subjectKeyId: E2:90:8D:36:9C:3C:A3:C1:13:BB:09:E2:4D:C1:CC:C5:A6:66:91:D4 + - subject: MEsxCzAJBgNVBAYTAlVTMQ8wDQYDVQQKDAZHb29nbGUxFTATBgNVBAMMDE1hdHRlciBQQUEgMTEUMBIGCisGAQQBgqJ8AgEMBDYwMDY= + subjectKeyId: B0:00:56:81:B8:88:62:89:62:80:E1:21:18:A1:A8:BE:09:DE:93:21 + - subject: MFUxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjEtMCsGA1UEAxMkRGlnaUNlcnQgVEVTVCBSb290IENBIGZvciBNQVRURVIgUEtJ + subjectKeyId: C0:E0:64:15:00:EC:67:E2:7C:AF:7C:6E:2D:49:94:C7:73:DE:B7:BA + - subject: MDAxLjAsBgNVBAMMJU5vbiBQcm9kdWN0aW9uIE9OTFkgLSBYRk4gUEFBIENsYXNzIDM= + subjectKeyId: F8:99:A9:D5:AD:71:71:E4:C3:81:7F:14:10:7F:78:F0:D9:F7:62:E9 + - subject: MEIxGDAWBgNVBAMMD01hdHRlciBUZXN0IFBBQTEQMA4GA1UECgwHU2Ftc3VuZzEUMBIGCisGAQQBgqJ8AgEMBDEwRTE= + subjectKeyId: CF:9E:0A:16:78:8B:40:30:EC:DD:AB:34:B9:C2:EC:7B:E5:34:55:C0 Brief: This method will search for the first line that contains ': ' char sequence. @@ -74,6 +78,9 @@ def parse_paa_root_certs(cmdpipe, paa_list): def write_paa_root_cert(cmdpipe, subject): + pem_read = False + subject_as_text_read = False + filename = 'paa-root-certs/dcld_mirror_' + \ re.sub('[^a-zA-Z0-9_-]', '', re.sub('[=, ]', '_', subject)) with open(filename + '.pem', 'wb+') as outfile: @@ -82,19 +89,30 @@ def write_paa_root_cert(cmdpipe, subject): if not line: break else: - if b'pem_cert: |' in line: + if b'pemCert: |' in line: while True: line = cmdpipe.stdout.readline() outfile.write(line.strip(b' \t')) if b'-----END CERTIFICATE-----' in line: + pem_read = True break - # convert pem file to der - with open(filename + '.pem', 'rb') as infile: - pem_certificate = x509.load_pem_x509_certificate(infile.read()) - with open(filename + '.der', 'wb+') as outfile: - der_certificate = pem_certificate.public_bytes( - serialization.Encoding.DER) - outfile.write(der_certificate) + if b'subjectAsText:' in line: + new_subject = line.split(b': ')[1].strip().decode("utf-8") + new_filename = 'paa-root-certs/dcld_mirror_' + \ + re.sub('[=,\\\\ ]', '_', new_subject) + subject_as_text_read = True + break + + # if successfully obtained all mandatory fields from the root certificate + if pem_read == True and subject_as_text_read == True: + os.rename(filename + '.pem', new_filename + '.pem') + # convert pem file to der + with open(new_filename + '.pem', 'rb') as infile: + pem_certificate = x509.load_pem_x509_certificate(infile.read()) + with open(new_filename + '.der', 'wb+') as outfile: + der_certificate = pem_certificate.public_bytes( + serialization.Encoding.DER) + outfile.write(der_certificate) def main(): @@ -120,7 +138,7 @@ def main(): for paa in paa_list: cmdpipe = subprocess.Popen( [dcld, 'query', 'pki', 'x509-cert', '-u', - paa[b'subject'].decode("utf-8"), '-k', paa[b'subject_key_id'].decode("utf-8")], + paa[b'subject'].decode("utf-8"), '-k', paa[b'subjectKeyId'].decode("utf-8")], stdout=subprocess.PIPE, stderr=subprocess.PIPE) write_paa_root_cert(cmdpipe, paa[b'subject'].decode("utf-8")) diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.der b/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.der new file mode 100644 index 00000000000000..7671b00e55a097 Binary files /dev/null and b/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.der differ diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.pem b/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.pem new file mode 100644 index 00000000000000..f47f70501dd6d9 --- /dev/null +++ b/credentials/development/paa-root-certs/dcld_mirror_CN_DigiCert_TEST_Root_CA_for_MATTER_PKI_O_DigiCert___Inc._C_US.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB7DCCAZKgAwIBAgIQMV46uClrVWJ4ZxcpJqr22DAKBggqhkjOPQQDAjBVMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLTArBgNVBAMTJERp +Z2lDZXJ0IFRFU1QgUm9vdCBDQSBmb3IgTUFUVEVSIFBLSTAgFw0yMjA2MDEwMDAw +MDBaGA85OTk5MTIzMTIzNTk1OVowVTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRp +Z2lDZXJ0LCBJbmMuMS0wKwYDVQQDEyREaWdpQ2VydCBURVNUIFJvb3QgQ0EgZm9y +IE1BVFRFUiBQS0kwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQChzJYO4tGlo0J +YR48DhcqbhiPsYM+I4iDQ44pCQiy1tt2k3lwpo2w6VtqNzj2rwHicsRNsC68c9wD +IaPmNeuTo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV +HQ4EFgQUwOBkFQDsZ+J8r3xuLUmUx3Pet7owCgYIKoZIzj0EAwIDSAAwRQIgRQv2 +ij1REVJ0UnqknV1XqCtsZOgBUOjCXlFp9nxQtoACIQCK0ehUL8ewgYWGzByw9yWs +WBmRC9nEToE88lIXCAWbUg== +-----END CERTIFICATE----- diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_1361413724421_130436303036.der b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_vid_0x6006.der similarity index 100% rename from credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_1361413724421_130436303036.der rename to credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_vid_0x6006.der diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_1361413724421_130436303036.pem b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_vid_0x6006.pem similarity index 100% rename from credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_1361413724421_130436303036.pem rename to credentials/development/paa-root-certs/dcld_mirror_CN_Matter_PAA_1_O_Google_C_US_vid_0x6006.pem diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.der b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.der new file mode 100644 index 00000000000000..321f5ba6b4409a Binary files /dev/null and b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.der differ diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.pem b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.pem new file mode 100644 index 00000000000000..120dc7b248a177 --- /dev/null +++ b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_O_Samsung_vid_0x10E1.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB6jCCAY+gAwIBAgIRAMWj7cxNY7POQiYwfAEW3hEwCgYIKoZIzj0EAwIwQjEY +MBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFBMRAwDgYDVQQKDAdTYW1zdW5nMRQwEgYK +KwYBBAGConwCAQwEMTBFMTAeFw0yMjA2MTYwODIwMTNaFw0zMjA2MTMwODIwMTNa +MEIxGDAWBgNVBAMMD01hdHRlciBUZXN0IFBBQTEQMA4GA1UECgwHU2Ftc3VuZzEU +MBIGCisGAQQBgqJ8AgEMBDEwRTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASO +JI7ctLMBwuOOLDgz74ncmBaKUqRadDIZkBCLczS3ckG4Ty6sJdWBrA5U8vnpncMg +qMMAppiYUXy33CEg2y0So2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQUz54KFniLQDDs3as0ucLse+U0VcAwHwYDVR0jBBgw +FoAUz54KFniLQDDs3as0ucLse+U0VcAwCgYIKoZIzj0EAwIDSQAwRgIhAKAjdnZk +FnHDMfhjmhBM+Iy1yLuHIKQxzKSMKSBDwqs9AiEA/FdiFtWLTFiRMVqYw1Cn5ryF +VucH+4/cuLf3wdKRl08= +-----END CERTIFICATE----- diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.der b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.der new file mode 100644 index 00000000000000..f3e86a5ee19652 Binary files /dev/null and b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.der differ diff --git a/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.pem b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.pem new file mode 100644 index 00000000000000..b9cd08a28f2512 --- /dev/null +++ b/credentials/development/paa-root-certs/dcld_mirror_CN_Matter_Test_PAA_vid_0x125D.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBvDCCAWKgAwIBAgIGAX+LduKHMAoGCCqGSM49BAMCMDAxGDAWBgNVBAMMD01h +dHRlciBUZXN0IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDEyNUQwIBcNMjIwMzE1MDI0 +NDU4WhgPMjEyMjAzMTUwMjQ0NThaMDAxGDAWBgNVBAMMD01hdHRlciBUZXN0IFBB +QTEUMBIGCisGAQQBgqJ8AgEMBDEyNUQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC +AAQJ5S9EoWLHKeQc8mfaoVHf0+xgv6kfVxVPm5kStvm1lToFvAGWeq2QqhXWZfcN +x2++l2fDriD0oXKnssJJ0hx5o2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMB8GA1Ud +IwQYMBaAFOKQjTacPKPBE7sJ4k3BzMWmZpHUMB0GA1UdDgQWBBTikI02nDyjwRO7 +CeJNwczFpmaR1DAOBgNVHQ8BAf8EBAMCAQYwCgYIKoZIzj0EAwIDSAAwRQIhAPZJ +skxY48EcSnatPseu6GcuFZw/bE/7uvp/PknnofJVAiAFXbU9SkxGi+Lqqa4YQRx9 +tpcQ/mhg7DECwutZLCxKyA== +-----END CERTIFICATE----- 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 bd143842f348c6..3bedf93145bbea 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 @@ -48,6 +48,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -776,7 +780,7 @@ server cluster PowerSourceConfiguration = 46 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -803,7 +807,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -828,7 +832,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -841,12 +845,12 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; - readonly attribute enum8 batteryChargeLevel = 14; - readonly attribute boolean batteryReplacementNeeded = 15; - readonly attribute enum8 batteryReplaceability = 16; + readonly attribute BatChargeLevel batChargeLevel = 14; + readonly attribute boolean batReplacementNeeded = 15; + readonly attribute BatReplaceability batReplaceability = 16; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -3913,9 +3917,9 @@ endpoint 0 { ram attribute status; ram attribute order default = 3; ram attribute description default = "B1"; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; ram attribute featureMap default = 2; ram attribute clusterRevision default = 1; } @@ -4219,9 +4223,9 @@ endpoint 1 { ram attribute status; ram attribute order default = 2; ram attribute description default = "B2"; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; ram attribute featureMap default = 2; ram attribute clusterRevision default = 1; } @@ -4741,9 +4745,9 @@ endpoint 2 { ram attribute status; ram attribute order default = 1; ram attribute description default = "B3"; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; ram attribute featureMap default = 2; ram attribute clusterRevision default = 1; } 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 f0d147522ad94e..eb3ec315b55416 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 @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -16,17 +16,17 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", - "version": "ZCL Test Data", - "type": "zcl-properties" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", + "version": "ZCL Test Data", + "type": "zcl-properties" } ], "endpointTypes": [ @@ -2219,7 +2219,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2299,7 +2299,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2391,7 +2391,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -2407,7 +2407,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -2423,7 +2423,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -2439,11 +2439,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2455,7 +2455,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -2471,11 +2471,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2487,7 +2487,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -2503,7 +2503,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -2519,7 +2519,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -2535,7 +2535,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -2551,7 +2551,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -2567,7 +2567,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -2583,7 +2583,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -2599,7 +2599,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -2615,7 +2615,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -2631,11 +2631,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2647,7 +2647,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -2663,7 +2663,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -2679,7 +2679,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -2695,7 +2695,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -8106,166 +8106,6 @@ } ] }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "zone state", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IAS CIE address", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Zone ID", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Test Cluster", "code": 4294048773, @@ -11018,7 +10858,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11098,7 +10938,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11190,7 +11030,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -11206,7 +11046,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -11222,7 +11062,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -11238,11 +11078,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11254,7 +11094,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -11270,11 +11110,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11286,7 +11126,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -11302,7 +11142,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -11318,7 +11158,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -11334,7 +11174,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -11350,7 +11190,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -11366,7 +11206,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -11382,7 +11222,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -11398,7 +11238,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -11414,7 +11254,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -11430,11 +11270,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11446,7 +11286,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -11462,7 +11302,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -11478,7 +11318,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -11494,7 +11334,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -13773,7 +13613,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13949,7 +13789,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17366,22 +17206,13 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Wake on LAN", + "code": 1283, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "WAKE_ON_LAN_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -17393,7 +17224,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -17402,256 +17233,89 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Wake on LAN", + "code": 1283, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "WAKE_ON_LAN_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { - "name": "zone state", + "name": "MACAddress", "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "zone type", - "code": 1, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "zone status", - "code": 2, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "IAS CIE address", - "code": 16, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "Zone ID", - "code": 17, + "name": "FeatureMap", + "code": 65532, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xff", - "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": "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": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Wake on LAN", - "code": 1283, - "mfgCode": null, - "define": "WAKE_ON_LAN_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "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": "Wake on LAN", - "code": 1283, - "mfgCode": null, - "define": "WAKE_ON_LAN_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "MACAddress", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "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": "0", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -19170,48 +18834,294 @@ ] }, { - "name": "Test Cluster", - "code": 4294048773, + "name": "Electrical Measurement", + "code": 2820, "mfgCode": null, - "define": "TEST_CLUSTER", + "define": "ELECTRICAL_MEASUREMENT_CLUSTER", "side": "client", "enabled": 0, - "commands": [ + "commands": [], + "attributes": [ { - "name": "Test", + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Measurement", + "code": 2820, + "mfgCode": null, + "define": "ELECTRICAL_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "measurement type", "code": 0, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestNotHandled", - "code": 1, + "name": "total active power", + "code": 772, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestSpecific", - "code": 2, + "name": "rms voltage", + "code": 1285, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestAddArguments", - "code": 4, + "name": "rms voltage min", + "code": 1286, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestStructArgumentRequest", - "code": 7, + "name": "rms voltage max", + "code": 1287, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current", + "code": 1288, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current min", + "code": 1289, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current max", + "code": 1290, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power", + "code": 1291, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power min", + "code": 1292, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power max", + "code": 1293, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "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": "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": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 4294048773, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestAddArguments", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestStructArgumentRequest", + "code": 7, "mfgCode": null, "source": "client", "incoming": 1, @@ -20595,355 +20505,109 @@ "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_char_string", - "code": 16414, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_enum_attr", - "code": 16420, - "mfgCode": null, - "side": "server", - "type": "SimpleEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_struct", - "code": 16421, - "mfgCode": null, - "side": "server", - "type": "SimpleStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8u", - "code": 16422, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "70", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8s", - "code": 16423, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-20", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16u", - "code": 16424, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "200", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16s", - "code": 16425, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-100", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "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": "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": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "measurement type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "total active power", - "code": 772, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage", - "code": 1285, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms voltage min", - "code": 1286, + "name": "nullable_char_string", + "code": 16414, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms voltage max", - "code": 1287, + "name": "nullable_enum_attr", + "code": 16420, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "SimpleEnum", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current", - "code": 1288, + "name": "nullable_struct", + "code": 16421, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "SimpleStruct", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current min", - "code": 1289, + "name": "nullable_range_restricted_int8u", + "code": 16422, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "70", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current max", - "code": 1290, + "name": "nullable_range_restricted_int8s", + "code": 16423, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "-20", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power", - "code": 1291, + "name": "nullable_range_restricted_int16u", + "code": 16424, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "200", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power min", - "code": 1292, + "name": "nullable_range_restricted_int16s", + "code": 16425, "mfgCode": null, "side": "server", "type": "int16s", @@ -20951,26 +20615,26 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "-100", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power max", - "code": 1293, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -20999,7 +20663,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -22344,7 +22008,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -22424,7 +22088,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22516,7 +22180,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -22532,7 +22196,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -22548,7 +22212,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -22564,11 +22228,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -22580,7 +22244,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -22596,11 +22260,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -22612,7 +22276,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -22628,7 +22292,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -22644,7 +22308,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -22660,7 +22324,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -22676,7 +22340,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -22692,7 +22356,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -22708,7 +22372,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -22724,7 +22388,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -22740,7 +22404,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -22756,11 +22420,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22772,7 +22436,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -22788,7 +22452,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -22804,7 +22468,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -22820,7 +22484,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -24613,166 +24277,6 @@ "reportableChange": 0 } ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "zone state", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IAS CIE address", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Zone ID", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] } ] }, @@ -25158,6 +24662,5 @@ "endpointVersion": 1, "deviceIdentifier": 61442 } - ], - "log": [] -} + ] +} \ No newline at end of file diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index 246825835638eb..d413072f671db1 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -309,7 +309,7 @@ class EditAttributeListModel : public TouchesMatterStackModel { // update the battery percent remaining here for hardcoded endpoint 1 ESP_LOGI(TAG, "Battery percent remaining changed to : %d", n); - app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(n * 2)); + app::Clusters::PowerSource::Attributes::BatPercentRemaining::Set(1, static_cast(n * 2)); } value = buffer; } @@ -373,7 +373,7 @@ class EditAttributeListModel : public TouchesMatterStackModel // update the battery charge level here for hardcoded endpoint 1 ESP_LOGI(TAG, "Battery charge level changed to : %u", static_cast(attributeValue)); - app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(attributeValue)); + app::Clusters::PowerSource::Attributes::BatChargeLevel::Set(1, attributeValue); } else { @@ -686,9 +686,9 @@ void SetupPretendDevices() AddEndpoint("1"); AddCluster("Power Source"); AddAttribute("Bat remaining", "70"); - app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(70 * 2)); + app::Clusters::PowerSource::Attributes::BatPercentRemaining::Set(1, static_cast(70 * 2)); AddAttribute("Charge level", "0"); - app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(0)); + app::Clusters::PowerSource::Attributes::BatChargeLevel::Set(1, app::Clusters::PowerSource::BatChargeLevel::kOk); } esp_err_t InitM5Stack(std::string qrCodeText) diff --git a/examples/all-clusters-app/p6/BUILD.gn b/examples/all-clusters-app/p6/BUILD.gn index 59ae7f12293bac..3e8ab5e40b641b 100644 --- a/examples/all-clusters-app/p6/BUILD.gn +++ b/examples/all-clusters-app/p6/BUILD.gn @@ -41,10 +41,10 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = + "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] diff --git a/examples/all-clusters-app/tizen/.gn b/examples/all-clusters-app/tizen/.gn new file mode 100644 index 00000000000000..c50b81609edec2 --- /dev/null +++ b/examples/all-clusters-app/tizen/.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2020 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/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_os = "tizen" + import("//args.gni") +} diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn new file mode 100644 index 00000000000000..d860d723befcfe --- /dev/null +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -0,0 +1,77 @@ +# Copyright (c) 2020 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/tizen.gni") + +import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/app/common_flags.gni") + +import("${tizen_sdk_build_root}/tizen_sdk.gni") +assert(chip_build_tools) + +source_set("chip-all-clusters-common") { + sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", + ] + + deps = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common", + "${chip_root}/src/lib/shell:shell_core", + ] + + include_dirs = + [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] +} + +executable("chip-all-clusters-app") { + sources = [ + "include/CHIPProjectAppConfig.h", + "src/main.cpp", + ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/tizen:app-main", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/zzz_generated/all-clusters-app", + "include", + ] + + output_dir = root_out_dir +} + +tizen_sdk_package("chip-all-clusters-app:tpk") { + deps = [ ":chip-all-clusters-app" ] + manifest = rebase_path("tizen-manifest.xml") + sign_security_profile = "CHIP" +} + +group("tizen") { + deps = [ ":chip-all-clusters-app" ] +} + +group("tizen:tpk") { + deps = [ ":chip-all-clusters-app:tpk" ] +} + +group("default") { + deps = [ ":tizen" ] +} diff --git a/examples/all-clusters-app/tizen/args.gni b/examples/all-clusters-app/tizen/args.gni new file mode 100644 index 00000000000000..41e334d3bd52d8 --- /dev/null +++ b/examples/all-clusters-app/tizen/args.gni @@ -0,0 +1,25 @@ +# Copyright (c) 2020 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}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/all-clusters-app/tizen/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-app/tizen/build_overrides b/examples/all-clusters-app/tizen/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/all-clusters-app/tizen/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/darwin-framework-tool/commands/common/MTRCluster_Externs.h b/examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h similarity index 59% rename from examples/darwin-framework-tool/commands/common/MTRCluster_Externs.h rename to examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h index a71c5301deba2c..cecc041dc2d34b 100644 --- a/examples/darwin-framework-tool/commands/common/MTRCluster_Externs.h +++ b/examples/all-clusters-app/tizen/include/CHIPProjectAppConfig.h @@ -1,6 +1,7 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2020 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. @@ -15,18 +16,16 @@ * limitations under the License. */ -#ifndef MTR_CLUSTER_EXTERNS_H -#define MTR_CLUSTER_EXTERNS_H - -#import - -#import - -@interface MTRCluster (PrivateExtensions) -@property (readonly, nonatomic) dispatch_queue_t callbackQueue; +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ -- (chip::ByteSpan)asByteSpan:(NSData *)value; -- (chip::CharSpan)asCharSpan:(NSString *)value; -@end +#pragma once -#endif +// include the CHIPProjectConfig from config/standalone +#include diff --git a/examples/all-clusters-app/tizen/src/main.cpp b/examples/all-clusters-app/tizen/src/main.cpp new file mode 100644 index 00000000000000..89002ef05bc3e0 --- /dev/null +++ b/examples/all-clusters-app/tizen/src/main.cpp @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2020 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 +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +// Network commissioning +namespace { +constexpr EndpointId kNetworkCommissioningEndpointMain = 0; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; +} // namespace + +void ApplicationInit() +{ + // Enable secondary endpoint only when we need it. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); +} + +int main(int argc, char * argv[]) +{ + TizenServiceAppMain app; + VerifyOrDie(app.Init(argc, argv) == 0); + + VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); + + return app.RunMainLoop(); +} diff --git a/examples/all-clusters-app/tizen/third_party/connectedhomeip b/examples/all-clusters-app/tizen/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/all-clusters-app/tizen/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/all-clusters-app/tizen/tizen-manifest.xml b/examples/all-clusters-app/tizen/tizen-manifest.xml new file mode 100644 index 00000000000000..dfd08655700512 --- /dev/null +++ b/examples/all-clusters-app/tizen/tizen-manifest.xml @@ -0,0 +1,17 @@ + + + + + + + + http://tizen.org/privilege/bluetooth + http://tizen.org/privilege/internet + http://tizen.org/privilege/network.get + + true + true + true + true + true + diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 0943510a9b81d6..cf398400d456a2 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -42,6 +42,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -708,7 +712,7 @@ server cluster PowerSourceConfiguration = 46 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -735,7 +739,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -760,7 +764,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -773,7 +777,7 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; readonly attribute bitmap32 featureMap = 65532; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 8a0a01ca25588f..238a2ffd37dab9 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -2219,7 +2219,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2299,7 +2299,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2391,7 +2391,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -2407,7 +2407,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -2423,7 +2423,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -2439,11 +2439,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2455,7 +2455,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -2471,11 +2471,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2487,7 +2487,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -2503,7 +2503,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -2519,7 +2519,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -2535,7 +2535,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -2551,7 +2551,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -2567,7 +2567,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -2583,7 +2583,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -2599,7 +2599,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -2615,7 +2615,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -2631,11 +2631,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2647,7 +2647,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -2663,7 +2663,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -2679,7 +2679,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -2695,7 +2695,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -8106,166 +8106,6 @@ } ] }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "zone state", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IAS CIE address", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Zone ID", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Test Cluster", "code": 4294048773, @@ -11018,7 +10858,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11098,7 +10938,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11190,7 +11030,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -11206,7 +11046,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -11222,7 +11062,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -11238,11 +11078,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11254,7 +11094,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -11270,11 +11110,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11286,7 +11126,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -11302,7 +11142,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -11318,7 +11158,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -11334,7 +11174,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -11350,7 +11190,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -11366,7 +11206,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -11382,7 +11222,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -11398,7 +11238,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -11414,7 +11254,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -11430,11 +11270,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11446,7 +11286,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -11462,7 +11302,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -11478,7 +11318,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -11494,7 +11334,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -13693,7 +13533,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13869,7 +13709,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -17270,22 +17110,13 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Wake on LAN", + "code": 1283, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "WAKE_ON_LAN_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -17297,7 +17128,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -17306,54 +17137,21 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Wake on LAN", + "code": 1283, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "WAKE_ON_LAN_CLUSTER", "side": "server", - "enabled": 0, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "enabled": 1, + "commands": [], "attributes": [ { - "name": "zone state", + "name": "MACAddress", "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, + "type": "char_string", + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -17364,51 +17162,51 @@ "reportableChange": 0 }, { - "name": "zone status", - "code": 2, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "IAS CIE address", - "code": 16, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "Zone ID", - "code": 17, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -17437,141 +17235,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Wake on LAN", - "code": 1283, - "mfgCode": null, - "define": "WAKE_ON_LAN_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "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": "Wake on LAN", - "code": 1283, - "mfgCode": null, - "define": "WAKE_ON_LAN_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "MACAddress", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "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": "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", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19157,63 +18821,309 @@ ] }, { - "name": "Test Cluster", - "code": 4294048773, + "name": "Electrical Measurement", + "code": 2820, "mfgCode": null, - "define": "TEST_CLUSTER", + "define": "ELECTRICAL_MEASUREMENT_CLUSTER", "side": "client", "enabled": 0, - "commands": [ + "commands": [], + "attributes": [ { - "name": "Test", - "code": 0, + "name": "ClusterRevision", + "code": 65533, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Measurement", + "code": 2820, + "mfgCode": null, + "define": "ELECTRICAL_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "TestNotHandled", - "code": 1, + "name": "measurement type", + "code": 0, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestSpecific", - "code": 2, + "name": "total active power", + "code": 772, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestAddArguments", - "code": 4, + "name": "rms voltage", + "code": 1285, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestStructArgumentRequest", - "code": 7, + "name": "rms voltage min", + "code": 1286, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "TestNestedStructArgumentRequest", - "code": 8, + "name": "rms voltage max", + "code": 1287, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "TestListStructArgumentRequest", + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current", + "code": 1288, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current min", + "code": 1289, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "rms current max", + "code": 1290, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power", + "code": 1291, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power min", + "code": 1292, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "active power max", + "code": 1293, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xffff", + "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": "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": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 4294048773, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestAddArguments", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestStructArgumentRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestNestedStructArgumentRequest", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestListStructArgumentRequest", "code": 9, "mfgCode": null, "source": "client", @@ -20580,357 +20490,111 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_char_string", - "code": 16414, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_enum_attr", - "code": 16420, - "mfgCode": null, - "side": "server", - "type": "SimpleEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_struct", - "code": 16421, - "mfgCode": null, - "side": "server", - "type": "SimpleStruct", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8u", - "code": 16422, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "70", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int8s", - "code": 16423, - "mfgCode": null, - "side": "server", - "type": "int8s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-20", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16u", - "code": 16424, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "200", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "nullable_range_restricted_int16s", - "code": 16425, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "-100", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 0, - "storageOption": "External", - "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": "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": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "measurement type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "total active power", - "code": 772, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage", - "code": 1285, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms voltage min", - "code": 1286, + "name": "nullable_char_string", + "code": 16414, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms voltage max", - "code": 1287, + "name": "nullable_enum_attr", + "code": 16420, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "SimpleEnum", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current", - "code": 1288, + "name": "nullable_struct", + "code": 16421, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "SimpleStruct", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current min", - "code": 1289, + "name": "nullable_range_restricted_int8u", + "code": 16422, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "70", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "rms current max", - "code": 1290, + "name": "nullable_range_restricted_int8s", + "code": 16423, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "-20", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power", - "code": 1291, + "name": "nullable_range_restricted_int16u", + "code": 16424, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "200", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power min", - "code": 1292, + "name": "nullable_range_restricted_int16s", + "code": 16425, "mfgCode": null, "side": "server", "type": "int16s", @@ -20938,26 +20602,26 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "-100", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "active power max", - "code": 1293, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", + "type": "array", + "included": 0, + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xffff", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -20986,7 +20650,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -22331,7 +21995,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -22411,7 +22075,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22503,7 +22167,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -22519,7 +22183,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -22535,7 +22199,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -22551,11 +22215,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22567,7 +22231,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -22583,11 +22247,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22599,7 +22263,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -22615,7 +22279,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -22631,7 +22295,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -22647,7 +22311,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -22663,7 +22327,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -22679,7 +22343,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -22695,7 +22359,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -22711,7 +22375,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -22727,7 +22391,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -22743,11 +22407,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22759,7 +22423,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -22775,7 +22439,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -22791,7 +22455,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -22807,7 +22471,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -24600,166 +24264,6 @@ "reportableChange": 0 } ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "zone state", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IAS CIE address", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "node_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Zone ID", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] } ] }, @@ -25146,4 +24650,4 @@ "deviceIdentifier": 61442 } ] -} +} \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp index 987a095134b16d..9557c97851d08e 100644 --- a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp @@ -219,7 +219,7 @@ class EditAttributeListModel : public TouchesMatterStackModel { // update the battery percent remaining here for hardcoded endpoint 1 ESP_LOGI(TAG, "Battery percent remaining changed to : %d", n); - app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(n * 2)); + app::Clusters::PowerSource::Attributes::BatPercentRemaining::Set(1, static_cast(n * 2)); } value = buffer; } @@ -283,7 +283,7 @@ class EditAttributeListModel : public TouchesMatterStackModel // update the battery charge level here for hardcoded endpoint 1 ESP_LOGI(TAG, "Battery charge level changed to : %u", static_cast(attributeValue)); - app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(attributeValue)); + app::Clusters::PowerSource::Attributes::BatChargeLevel::Set(1, attributeValue); } else { @@ -590,9 +590,9 @@ void SetupPretendDevices() AddEndpoint("1"); AddCluster("Power Source"); AddAttribute("Bat remaining", "70"); - app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::Set(1, static_cast(70 * 2)); + app::Clusters::PowerSource::Attributes::BatPercentRemaining::Set(1, static_cast(70 * 2)); AddAttribute("Charge level", "0"); - app::Clusters::PowerSource::Attributes::BatteryChargeLevel::Set(1, static_cast(0)); + app::Clusters::PowerSource::Attributes::BatChargeLevel::Set(1, app::Clusters::PowerSource::BatChargeLevel::kOk); } esp_err_t InitM5Stack(std::string qrCodeText) diff --git a/examples/all-clusters-minimal-app/p6/BUILD.gn b/examples/all-clusters-minimal-app/p6/BUILD.gn index a9b88c2125b219..20fced280e6ea8 100644 --- a/examples/all-clusters-minimal-app/p6/BUILD.gn +++ b/examples/all-clusters-minimal-app/p6/BUILD.gn @@ -41,10 +41,10 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = + "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] diff --git a/examples/all-clusters-minimal-app/tizen/.gn b/examples/all-clusters-minimal-app/tizen/.gn new file mode 100644 index 00000000000000..c50b81609edec2 --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2020 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/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_os = "tizen" + import("//args.gni") +} diff --git a/examples/all-clusters-minimal-app/tizen/BUILD.gn b/examples/all-clusters-minimal-app/tizen/BUILD.gn new file mode 100644 index 00000000000000..07b6bf6260943e --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/BUILD.gn @@ -0,0 +1,77 @@ +# Copyright (c) 2020 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/tizen.gni") + +import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/app/common_flags.gni") + +import("${tizen_sdk_build_root}/tizen_sdk.gni") +assert(chip_build_tools) + +source_set("chip-all-clusters-common") { + sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", + ] + + deps = [ + "${chip_root}/examples/all-clusters-minimal-app/all-clusters-common", + "${chip_root}/src/lib/shell:shell_core", + ] + + include_dirs = + [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] +} + +executable("chip-all-clusters-minimal-app") { + sources = [ + "include/CHIPProjectAppConfig.h", + "src/main.cpp", + ] + + deps = [ + ":chip-all-clusters-common", + "${chip_root}/examples/platform/tizen:app-main", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/zzz_generated/all-clusters-minimal-app", + "include", + ] + + output_dir = root_out_dir +} + +tizen_sdk_package("chip-all-clusters-minimal-app:tpk") { + deps = [ ":chip-all-clusters-minimal-app" ] + manifest = rebase_path("tizen-manifest.xml") + sign_security_profile = "CHIP" +} + +group("tizen") { + deps = [ ":chip-all-clusters-minimal-app" ] +} + +group("tizen:tpk") { + deps = [ ":chip-all-clusters-minimal-app:tpk" ] +} + +group("default") { + deps = [ ":tizen" ] +} diff --git a/examples/all-clusters-minimal-app/tizen/args.gni b/examples/all-clusters-minimal-app/tizen/args.gni new file mode 100644 index 00000000000000..bf1ef5219e5d93 --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/args.gni @@ -0,0 +1,25 @@ +# Copyright (c) 2020 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}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/all-clusters-minimal-app/tizen/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/all-clusters-minimal-app/tizen/build_overrides b/examples/all-clusters-minimal-app/tizen/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/darwin-framework-tool/commands/common/MTRDevice_Externs.h b/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h similarity index 56% rename from examples/darwin-framework-tool/commands/common/MTRDevice_Externs.h rename to examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h index 33e8b613e29065..cecc041dc2d34b 100644 --- a/examples/darwin-framework-tool/commands/common/MTRDevice_Externs.h +++ b/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h @@ -1,6 +1,7 @@ -/** +/* * * Copyright (c) 2020 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. @@ -15,26 +16,16 @@ * limitations under the License. */ -#ifndef MTR_DEVICE_EXTERNS_H -#define MTR_DEVICE_EXTERNS_H - -#import -#import - -#include -#include -#include - -NS_ASSUME_NONNULL_BEGIN - -@interface MTRDevice (InternalIntrospection) - -// TODO: remove me -// Used to access the internal chip::DeviceProxy from TestCommandBridge -- (chip::DeviceProxy *)internalDevice; - -@end +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ -NS_ASSUME_NONNULL_END +#pragma once -#endif /* MTR_DEVICE_EXTERNS_H */ +// include the CHIPProjectConfig from config/standalone +#include diff --git a/examples/all-clusters-minimal-app/tizen/src/main.cpp b/examples/all-clusters-minimal-app/tizen/src/main.cpp new file mode 100644 index 00000000000000..89002ef05bc3e0 --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/src/main.cpp @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2020 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 +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +// Network commissioning +namespace { +constexpr EndpointId kNetworkCommissioningEndpointMain = 0; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; +} // namespace + +void ApplicationInit() +{ + // Enable secondary endpoint only when we need it. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); +} + +int main(int argc, char * argv[]) +{ + TizenServiceAppMain app; + VerifyOrDie(app.Init(argc, argv) == 0); + + VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); + + return app.RunMainLoop(); +} diff --git a/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip b/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml b/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml new file mode 100644 index 00000000000000..ca1b4edc263bdc --- /dev/null +++ b/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml @@ -0,0 +1,17 @@ + + + + + + + + http://tizen.org/privilege/bluetooth + http://tizen.org/privilege/internet + http://tizen.org/privilege/network.get + + true + true + true + true + true + diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index d069d8ce7a0caf..d0b411446a210b 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -435,9 +435,8 @@ void HandleDevicePowerSourceStatusChanged(DevicePowerSource * dev, DevicePowerSo if (itemChangedMask & DevicePowerSource::kChanged_BatLevel) { uint8_t batChargeLevel = dev->GetBatChargeLevel(); - MatterReportingAttributeChangeCallback(dev->GetEndpointId(), PowerSource::Id, - PowerSource::Attributes::BatteryChargeLevel::Id, ZCL_INT8U_ATTRIBUTE_TYPE, - &batChargeLevel); + MatterReportingAttributeChangeCallback(dev->GetEndpointId(), PowerSource::Id, PowerSource::Attributes::BatChargeLevel::Id, + ZCL_INT8U_ATTRIBUTE_TYPE, &batChargeLevel); } if (itemChangedMask & DevicePowerSource::kChanged_Description) @@ -549,7 +548,7 @@ EmberAfStatus HandleReadPowerSourceAttribute(DevicePowerSource * dev, chip::Attr uint16_t maxReadLength) { using namespace app::Clusters; - if ((attributeId == PowerSource::Attributes::BatteryChargeLevel::Id) && (maxReadLength == 1)) + if ((attributeId == PowerSource::Attributes::BatChargeLevel::Id) && (maxReadLength == 1)) { *buffer = dev->GetBatChargeLevel(); } diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 4796b795981c06..b3703264bd46bc 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -304,7 +304,8 @@ def main(argv: Sequence[str]) -> None: choices=['nrfconnect', 'esp32', 'linux', 'silabs-thread'], metavar="TARGET", default="esp32") - parser.add_option("-r", "--rpc", help="enables Pigweed RPC interface. Enabling RPC disables the shell interface. Your sdkconfig configurations will be reverted to default. Default is PW RPC off. When enabling or disabling this flag, on the first build force a clean build with -c", action="store_true", dest="do_rpc") + parser.add_option("-r", "--rpc", help="enables Pigweed RPC interface. Enabling RPC disables the shell interface. Your sdkconfig configurations will be reverted to default. Default is PW RPC off. When enabling or disabling this flag, on the first build force a clean build with -c", + action="store_true", dest="do_rpc", default=False) parser.add_option("-a", "--automated_test_stamp", help="provide the additional stamp \"branch:commit_id\" as the software version string for automated tests.", action="store_true", dest="do_automated_test_stamp") parser.add_option("-v", "--vid", dest="vid", type=int, @@ -384,34 +385,36 @@ def main(argv: Sequence[str]) -> None: os.makedirs(archive_prefix, exist_ok=True) failed_builds = [] for device_name in _DEVICE_LIST: - for platform, label in cicd_config["cd_platforms"].items(): - command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform}" - flush_print(f"Building {command}", with_border=True) - shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") - shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"") - try: - shell.run_cmd(command) - except RuntimeError as build_fail_error: - failed_builds.append((device_name, platform, "build")) - flush_print(str(build_fail_error)) - if not options.keep_going: - exit(1) - continue - try: - bundle(platform, device_name) - except FileNotFoundError as bundle_fail_error: - failed_builds.append((device_name, platform, "bundle")) - flush_print(str(bundle_fail_error)) - if not options.keep_going: - exit(1) - continue - archive_name = f"{label}-{device_name}" - archive_full_name = archive_prefix + archive_name + archive_suffix - flush_print(f"Adding build output to archive {archive_full_name}") - if os.path.exists(archive_full_name): - os.remove(archive_full_name) - with tarfile.open(archive_full_name, "w:gz") as tar: - tar.add(_CD_STAGING_DIR, arcname=".") + for platform, label_args in cicd_config["cd_platforms"].items(): + for label, args in label_args.items(): + command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform} " + command += " ".join(args) + flush_print(f"Building {command}", with_border=True) + shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") + shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"") + try: + shell.run_cmd(command) + except RuntimeError as build_fail_error: + failed_builds.append((device_name, platform, "build")) + flush_print(str(build_fail_error)) + if not options.keep_going: + exit(1) + continue + try: + bundle(platform, device_name) + except FileNotFoundError as bundle_fail_error: + failed_builds.append((device_name, platform, "bundle")) + flush_print(str(bundle_fail_error)) + if not options.keep_going: + exit(1) + continue + archive_name = f"{label}-{device_name}" + archive_full_name = archive_prefix + archive_name + archive_suffix + flush_print(f"Adding build output to archive {archive_full_name}") + if os.path.exists(archive_full_name): + os.remove(archive_full_name) + with tarfile.open(archive_full_name, "w:gz") as tar: + tar.add(_CD_STAGING_DIR, arcname=".") if len(failed_builds) == 0: flush_print("No build failures", with_border=True) else: @@ -513,6 +516,7 @@ def main(argv: Sequence[str]) -> None: if options.do_build: sw_ver_string = "" + if options.do_automated_test_stamp: branch = "" for branch_text in shell.run_cmd("git branch", return_cmd_output=True).split("\n"): diff --git a/examples/chef/cicd_config.json b/examples/chef/cicd_config.json index ab283ae2a4b10f..f78baa7e3d3eee 100644 --- a/examples/chef/cicd_config.json +++ b/examples/chef/cicd_config.json @@ -1,8 +1,15 @@ { "ci_allow_list": ["rootnode_dimmablelight_bCwGYSDpoe"], "cd_platforms": { - "linux": "linux_x86", - "esp32": "m5stack", - "nrfconnect": "nrf52840dk" + "linux": { + "linux_x86": ["--cpu_type", "x64"], + "linux_arm64_ipv6only": ["--cpu_type", "arm64", "--ipv6only"] + }, + "esp32": { + "m5stack": [] + }, + "nrfconnect": { + "nrf52840dk": [] + } } } diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index ecc3ef52766d55..2a04a980a419a7 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -4,13 +4,18 @@ #include #include #include +#include -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, chip::Optional pinCode) +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, + chip::app::Clusters::DoorLock::DlOperationError & err) { + err = DlOperationError::kUnspecified; return true; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, chip::Optional pinCode) +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, + chip::app::Clusters::DoorLock::DlOperationError & err) { + err = DlOperationError::kUnspecified; return true; } diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 0c58d7735885bb..2f553f5d092407 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index d070ed93fc1abc..c418e260b39905 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 20103614458376..91db20992abfe3 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } client cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -54,6 +58,10 @@ client cluster Groups = 4 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index fc220f4cb9b7dd..16d8c8f83fae22 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 539668f0475025..1f8dd74275efa6 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } client cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -54,6 +58,10 @@ client cluster Groups = 4 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 3b78448864f4d8..44c2d10c6975bc 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } client cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -54,6 +58,10 @@ client cluster Groups = 4 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index c2b7b30949de15..76f87b241a18c5 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index cd3cd0c89ec7be..e6b811977e2e30 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 3f933195346c1c..572eb08ca369b8 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } client cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -54,6 +58,10 @@ client cluster Groups = 4 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 3546b0e09fa806..66cc663bc4def9 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 94aa19a747e47d..91a5ef6e428cb0 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } client cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -54,6 +58,10 @@ client cluster Groups = 4 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 901adc16bf2427..282bc79e226418 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 2215c28b3acc42..26b531774f3304 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -45,6 +45,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 59812076cfde75..0f738bc4da8ae8 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -312,7 +312,11 @@ bool Command::InitArgument(size_t argIndex, char * argValue) while (ss.good()) { std::string valueAsString; - getline(ss, valueAsString, ','); + // By default the parameter separator is ";" in order to not collapse with the argument itself if it contains commas + // (e.g a struct argument with multiple fields). In case one needs to use ";" it can be overriden with the following + // environment variable. + constexpr const char * kSeparatorVariable = "CHIPTOOL_CUSTOM_ARGUMENTS_SEPARATOR"; + getline(ss, valueAsString, getenv(kSeparatorVariable) ? getenv(kSeparatorVariable)[0] : ';'); CustomArgument * customArgument = new CustomArgument(); vectorArgument->push_back(customArgument); diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index 8a0235f7bb0fb3..28263ba287027d 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -30,8 +30,6 @@ constexpr const char * kInteractiveModeStopCommand = "quit()"; namespace { -bool gIsCommandRunning = false; - void ClearLine() { printf("\r\x1B[0J"); // Move cursor to the beginning of the line and clear from cursor to end of the screen @@ -42,11 +40,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, ClearLine(); chip::Logging::Platform::LogV(module, category, msg, args); ClearLine(); - - if (gIsCommandRunning == false) - { - rl_forced_update_display(); - } } } // namespace @@ -110,9 +103,7 @@ bool InteractiveStartCommand::ParseCommand(char * command) { if (argsCount == kInteractiveModeArgumentsMaxLength) { - gIsCommandRunning = true; ChipLogError(chipTool, "Too many arguments. Ignoring."); - gIsCommandRunning = false; return true; } @@ -122,9 +113,7 @@ bool InteractiveStartCommand::ParseCommand(char * command) } ClearLine(); - gIsCommandRunning = true; mHandler->RunInteractive(argsCount, args); - gIsCommandRunning = false; // Do not delete arg[0] while (--argsCount) diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 89a3d00135e510..64a833ab3176d7 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -41,7 +41,7 @@ CHIP_ERROR TestCommand::WaitForCommissionee(const char * identity, // or is just starting out fresh outright. Let's make sure we're not re-using any cached CASE sessions // that will now be stale and mismatched with the peer, causing subsequent interactions to fail. // - GetCommissioner(identity).SessionMgr()->ExpireAllPairings(chip::ScopedNodeId(value.nodeId, fabricIndex)); + GetCommissioner(identity).SessionMgr()->ExpireAllSessions(chip::ScopedNodeId(value.nodeId, fabricIndex)); SetIdentity(identity); return GetCommissioner(identity).GetConnectedDevice(value.nodeId, &mOnDeviceConnectedCallback, diff --git a/examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt b/examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt index b7a574e380173a..8250c27ba03230 100644 --- a/examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt +++ b/examples/chip-tool/templates/tests/partials/checks/maybeCheckExpectedConstraints.zapt @@ -40,6 +40,18 @@ {{/chip_tests_iterate_expected_list}} {{/if}} + {{~#if (hasProperty expectedConstraints "hasMasksSet")}} + {{#chip_tests_iterate_expected_list expectedConstraints.hasMasksSet}} + VerifyOrReturn(CheckConstraintHasMasksSet("{{asPropertyValue}}", {{asPropertyValue}}, {{asTypedLiteral value type}})); + {{/chip_tests_iterate_expected_list}} + {{/if}} + + {{~#if (hasProperty expectedConstraints "hasMasksClear")}} + {{#chip_tests_iterate_expected_list expectedConstraints.hasMasksClear}} + VerifyOrReturn(CheckConstraintHasMasksClear("{{asPropertyValue}}", {{asPropertyValue}}, {{asTypedLiteral value type}})); + {{/chip_tests_iterate_expected_list}} + {{/if}} + {{~#if (hasProperty expectedConstraints "notValue")}} {{#if (isLiteralNull expectedConstraints.notValue)}} VerifyOrReturn(CheckValueNonNull("{{asPropertyValue}}", {{asPropertyValue}})); @@ -53,4 +65,3 @@ {{/unless}} {{/if}} {{/if}} - diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 5469315293126e..0cdc445fd9ffa5 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -24,19 +24,38 @@ if (config_use_interactive_mode) { assert(chip_build_tools) +action("build-darwin-framwork") { + script = "${chip_root}/scripts/build/build_darwin_framework.py" + + inputs = [ "${chip_root}/src/darwin/Framework/Matter.xcodeproj" ] + + args = [ + "--project_path", + rebase_path("${chip_root}/src/darwin/Framework/Matter.xcodeproj", + root_build_dir), + "--out_path", + "macos_framework_output", + "--target", + "Matter", + "--log_path", + rebase_path("${root_build_dir}/darwin_framework_build.log", root_build_dir), + ] + + output_name = "Matter.framework" + outputs = [ "${root_out_dir}/macos_framework_output/${output_name}" ] +} + config("config") { include_dirs = [ ".", - "${chip_root}/src/darwin/Framework/CHIP/zap-generated", - "${chip_root}/src/darwin/Framework/CHIP", "${chip_root}/examples/darwin-framework-tool/commands/common", "${chip_root}/zzz_generated/darwin-framework-tool", "${chip_root}/zzz_generated/controller-clusters", "${chip_root}/examples/chip-tool/commands/clusters/ComplexArgument.h", - "/tmp/macos_framework_output", + "${root_out_dir}/macos_framework_output", ] - framework_dirs = [ "/tmp/macos_framework_output" ] + framework_dirs = [ "${root_out_dir}/macos_framework_output" ] defines = [ "CONFIG_ENABLE_YAML_TESTS=${config_enable_yaml_tests}", @@ -79,25 +98,26 @@ executable("darwin-framework-tool") { "main.mm", ] - if (config_use_interactive_mode) { - sources += [ "commands/interactive/InteractiveCommands.mm" ] - deps += [ "${editline_root}:editline" ] - } - - if (config_enable_yaml_tests) { - sources += [ "${chip_root}/zzz_generated/darwin-framework-tool/zap-generated/cluster/MTRTestClustersObjc.mm" ] - } - deps = [ + ":build-darwin-framwork", "${chip_root}/examples/chip-tool:chip-tool-utils", "${chip_root}/src/app/server", - "${chip_root}/src/darwin/Framework/CHIP:static-matter", "${chip_root}/src/lib", "${chip_root}/src/platform", "${chip_root}/third_party/inipp", "${chip_root}/third_party/jsoncpp", ] + if (config_use_interactive_mode) { + sources += [ "commands/interactive/InteractiveCommands.mm" ] + deps += [ "${editline_root}:editline" ] + } + + ldflags = [ + "-rpath", + "@executable_path/macos_framework_output/", + ] + frameworks = [ "Matter.framework", "Security.framework", diff --git a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h index c7c71a324e2a0d..fc20000bc72040 100644 --- a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h @@ -47,7 +47,7 @@ class ClusterCommand : public ModelCommand { ~ClusterCommand() {} - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override { chip::TLV::TLVWriter writer; chip::TLV::TLVReader reader; @@ -68,7 +68,7 @@ class ClusterCommand : public ModelCommand { return ClusterCommand::SendCommand(device, endpointId, mClusterId, mCommandId, commandFields); } - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId, + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId, chip::CommandId commandId, id _Nonnull commandFields) { uint16_t repeatCount = mRepeatCount.ValueOr(1); diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h index ad86fa79aa690e..df6cf196c04569 100644 --- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h @@ -42,7 +42,7 @@ class ModelCommand : public CHIPCommandBridge CHIP_ERROR RunCommand() override; chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); } - virtual CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endPointId) = 0; + virtual CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endPointId) = 0; private: chip::NodeId mNodeId; diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm index e039391b8e6289..31ab9d8cba1038 100644 --- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.mm @@ -29,27 +29,27 @@ MTRDeviceController * commissioner = CurrentCommissioner(); ChipLogProgress(chipTool, "Sending command to node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId)); - [commissioner getDevice:mNodeId - queue:callbackQueue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error != nil) { - SetCommandExitStatus(error, "Error getting connected device"); - return; - } - - CHIP_ERROR err; - if (device == nil) { - err = CHIP_ERROR_INTERNAL; - } else { - err = SendCommand(device, mEndPointId); - } - - if (err != CHIP_NO_ERROR) { - ChipLogError(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - return; - } - }]; + [commissioner getBaseDevice:mNodeId + queue:callbackQueue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error != nil) { + SetCommandExitStatus(error, "Error getting connected device"); + return; + } + + CHIP_ERROR err; + if (device == nil) { + err = CHIP_ERROR_INTERNAL; + } else { + err = SendCommand(device, mEndPointId); + } + + if (err != CHIP_NO_ERROR) { + ChipLogError(chipTool, "Error: %s", chip::ErrorStr(err)); + SetCommandExitStatus(err); + return; + } + }]; return CHIP_NO_ERROR; } diff --git a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h index 3357b12a8eada6..0330c226fcec03 100644 --- a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h @@ -50,7 +50,7 @@ class ReadAttribute : public ModelCommand { ~ReadAttribute() {} - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); MTRReadParams * params = [[MTRReadParams alloc] init]; @@ -125,7 +125,7 @@ class SubscribeAttribute : public ModelCommand { ~SubscribeAttribute() {} - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; @@ -195,7 +195,7 @@ class SubscribeEvent : public ModelCommand { ~SubscribeEvent() {} - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); diff --git a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h index 37df173a8c417b..826117f1ceea3c 100644 --- a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h @@ -47,7 +47,7 @@ class WriteAttribute : public ModelCommand { ~WriteAttribute() {} - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId) override { chip::TLV::TLVWriter writer; chip::TLV::TLVReader reader; @@ -69,7 +69,7 @@ class WriteAttribute : public ModelCommand { return WriteAttribute::SendCommand(device, endpointId, mClusterId, mAttributeId, value); } - CHIP_ERROR SendCommand(MTRDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId, + CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, id _Nonnull value) { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm index 7712eab13cd29f..45af924a7fee8b 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm @@ -67,7 +67,7 @@ - (nullable NSData *)storageDataForKey:(NSString *)key - (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key { - return CHIPSetDomainValueForKey(kCHIPToolDefaultsDomain, key, value); + return MTRSetDomainValueForKey(kCHIPToolDefaultsDomain, key, value); } - (BOOL)removeStorageDataForKey:(NSString *)key diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h index bd92c406c789c3..a58d2e8e703042 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h +++ b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h @@ -4,7 +4,7 @@ @interface CHIPToolKeypair : NSObject - (BOOL)initialize; -- (NSData *)ECDSA_sign_message_raw:(NSData *)message; +- (NSData *)signMessageECDSA_RAW:(NSData *)message; - (SecKeyRef)publicKey; - (CHIP_ERROR)Serialize:(chip::Crypto::P256SerializedKeypair &)output; - (CHIP_ERROR)Deserialize:(chip::Crypto::P256SerializedKeypair &)input; diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm index 56be3fa36b15a3..425a45fba62f83 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm @@ -33,7 +33,7 @@ - (BOOL)initialize return _mKeyPair.Initialize() == CHIP_NO_ERROR; } -- (NSData *)ECDSA_sign_message_raw:(NSData *)message +- (NSData *)signMessageECDSA_RAW:(NSData *)message { chip::Crypto::P256ECDSASignature signature; NSData * out_signature; diff --git a/examples/darwin-framework-tool/commands/common/MTRError.mm b/examples/darwin-framework-tool/commands/common/MTRError.mm index 5d0abd4b0137e8..05ff5a7331ad85 100644 --- a/examples/darwin-framework-tool/commands/common/MTRError.mm +++ b/examples/darwin-framework-tool/commands/common/MTRError.mm @@ -30,6 +30,20 @@ @interface MTRErrorHolder : NSObject @property (nonatomic, readonly) CHIP_ERROR error; @end +@implementation MTRErrorHolder + +- (instancetype)initWithError:(CHIP_ERROR)error +{ + if (!(self = [super init])) { + return nil; + } + + _error = error; + return self; +} + +@end + CHIP_ERROR MTRErrorToCHIPErrorCode(NSError * error) { if (error == nil) { diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index 24121ff7660f02..04117ee487b50d 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -32,8 +32,6 @@ namespace { -bool gIsCommandRunning = NO; - void ClearLine() { printf("\r\x1B[0J"); // Move cursor to the beginning of the line and clear from cursor to end of the screen @@ -44,10 +42,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, ClearLine(); chip::Logging::Platform::LogV(module, category, msg, args); ClearLine(); - - if (gIsCommandRunning == NO) { - rl_forced_update_display(); - } } } // namespace @@ -104,9 +98,7 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, std::stringstream ss(command); while (ss >> std::quoted(arg)) { if (argsCount == kInteractiveModeArgumentsMaxLength) { - gIsCommandRunning = YES; ChipLogError(chipTool, "Too many arguments. Ignoring."); - gIsCommandRunning = NO; return YES; } @@ -116,9 +108,7 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, } ClearLine(); - gIsCommandRunning = YES; mHandler->RunInteractive(argsCount, args); - gIsCommandRunning = NO; // Do not delete arg[0] while (--argsCount) diff --git a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm index 8a6935e9c6df34..e8fca6ab8771f5 100644 --- a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm @@ -111,46 +111,46 @@ { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip-tool.command", DISPATCH_QUEUE_SERIAL); MTRDeviceController * commissioner = CurrentCommissioner(); - [commissioner getDevice:mNodeId - queue:callbackQueue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - CHIP_ERROR err = CHIP_NO_ERROR; - if (error) { - err = MTRErrorToCHIPErrorCode(error); - LogNSError("Error: ", error); - SetCommandExitStatus(err); - } else if (device == nil) { - ChipLogError(chipTool, "Error: %s", chip::ErrorStr(CHIP_ERROR_INTERNAL)); - SetCommandExitStatus(CHIP_ERROR_INTERNAL); - } else { - ChipLogProgress(chipTool, "Attempting to unpair device %llu", mNodeId); - MTROperationalCredentials * opCredsCluster = [[MTROperationalCredentials alloc] initWithDevice:device - endpoint:0 - queue:callbackQueue]; - [opCredsCluster readAttributeCurrentFabricIndexWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable readError) { - if (readError) { - CHIP_ERROR readErr = MTRErrorToCHIPErrorCode(readError); - LogNSError("Failed to get current fabric: ", readError); - SetCommandExitStatus(readErr); - return; - } - MTROperationalCredentialsClusterRemoveFabricParams * params = - [[MTROperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.fabricIndex = value; - [opCredsCluster removeFabricWithParams:params - completionHandler:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, - NSError * _Nullable removeError) { - CHIP_ERROR removeErr = CHIP_NO_ERROR; - if (removeError) { - removeErr = MTRErrorToCHIPErrorCode(removeError); - LogNSError("Failed to remove current fabric: ", removeError); - } else { - ChipLogProgress(chipTool, "Successfully unpaired deviceId %llu", mNodeId); - } - SetCommandExitStatus(removeErr); - }]; - }]; - } - }]; + [commissioner getBaseDevice:mNodeId + queue:callbackQueue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + CHIP_ERROR err = CHIP_NO_ERROR; + if (error) { + err = MTRErrorToCHIPErrorCode(error); + LogNSError("Error: ", error); + SetCommandExitStatus(err); + } else if (device == nil) { + ChipLogError(chipTool, "Error: %s", chip::ErrorStr(CHIP_ERROR_INTERNAL)); + SetCommandExitStatus(CHIP_ERROR_INTERNAL); + } else { + ChipLogProgress(chipTool, "Attempting to unpair device %llu", mNodeId); + MTRBaseClusterOperationalCredentials * opCredsCluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:callbackQueue]; + [opCredsCluster readAttributeCurrentFabricIndexWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable readError) { + if (readError) { + CHIP_ERROR readErr = MTRErrorToCHIPErrorCode(readError); + LogNSError("Failed to get current fabric: ", readError); + SetCommandExitStatus(readErr); + return; + } + MTROperationalCredentialsClusterRemoveFabricParams * params = + [[MTROperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = value; + [opCredsCluster + removeFabricWithParams:params + completionHandler:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable data, + NSError * _Nullable removeError) { + CHIP_ERROR removeErr = CHIP_NO_ERROR; + if (removeError) { + removeErr = MTRErrorToCHIPErrorCode(removeError); + LogNSError("Failed to remove current fabric: ", removeError); + } else { + ChipLogProgress(chipTool, "Successfully unpaired deviceId %llu", mNodeId); + } + SetCommandExitStatus(removeErr); + }]; + }]; + } + }]; } diff --git a/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.h b/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.h index babbaf2e06b5c4..8fb9e90fad1c7c 100644 --- a/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.h +++ b/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.h @@ -18,7 +18,7 @@ #pragma once -#import +#import #include class SetupPayloadParseCommand : public Command { @@ -33,7 +33,7 @@ class SetupPayloadParseCommand : public Command { private: char * mCode; - CHIP_ERROR Print(CHIPSetupPayload * payload); + CHIP_ERROR Print(MTRSetupPayload * payload); // Will log the given string and given error (as progress if success, error // if failure). diff --git a/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.mm b/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.mm index 04d28646cb42af..1cd479c965a6a4 100644 --- a/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.mm +++ b/examples/darwin-framework-tool/commands/payload/SetupPayloadParseCommand.mm @@ -17,8 +17,8 @@ */ #include "SetupPayloadParseCommand.h" -#import -#import +#include "MTRError_Utils.h" +#import using namespace ::chip; @@ -26,16 +26,16 @@ #if CHIP_PROGRESS_LOGGING -NSString * CustomFlowString(CHIPCommissioningFlow flow) +NSString * CustomFlowString(MTRCommissioningFlow flow) { switch (flow) { - case kCommissioningFlowStandard: + case MTRCommissioningFlowStandard: return @"STANDARD"; - case kCommissioningFlowUserActionRequired: + case MTRCommissioningFlowUserActionRequired: return @"USER ACTION REQUIRED"; - case kCommissioningFlowCustom: + case MTRCommissioningFlowCustom: return @"CUSTOM"; - case kCommissioningFlowInvalid: + case MTRCommissioningFlowInvalid: return @"INVALID"; } @@ -48,7 +48,7 @@ void SetupPayloadParseCommand::LogNSError(const char * logString, NSError * error) { - CHIP_ERROR err = [CHIPError errorToCHIPErrorCode:error]; + CHIP_ERROR err = MTRErrorToCHIPErrorCode(error); if (err == CHIP_NO_ERROR) { ChipLogProgress(chipTool, "%s: %s", logString, chip::ErrorStr(err)); } else { @@ -60,14 +60,14 @@ { NSString * codeString = [NSString stringWithCString:mCode encoding:NSASCIIStringEncoding]; NSError * error; - CHIPSetupPayload * payload; - CHIPOnboardingPayloadType codeType; + MTRSetupPayload * payload; + MTROnboardingPayloadType codeType; if (IsQRCode(codeString)) { - codeType = CHIPOnboardingPayloadTypeQRCode; + codeType = MTROnboardingPayloadTypeQRCode; } else { - codeType = CHIPOnboardingPayloadTypeManualCode; + codeType = MTROnboardingPayloadTypeManualCode; } - payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:codeString ofType:codeType error:&error]; + payload = [MTROnboardingPayloadParser setupPayloadForOnboardingPayload:codeString ofType:codeType error:&error]; if (error) { LogNSError("Error: ", error); return CHIP_ERROR_INTERNAL; @@ -77,7 +77,7 @@ return CHIP_NO_ERROR; } -CHIP_ERROR SetupPayloadParseCommand::Print(CHIPSetupPayload * payload) +CHIP_ERROR SetupPayloadParseCommand::Print(MTRSetupPayload * payload) { NSLog(@"Version: %@", payload.version); NSLog(@"VendorID: %@", payload.vendorID); @@ -87,19 +87,19 @@ NSMutableString * humanFlags = [[NSMutableString alloc] init]; if (payload.rendezvousInformation) { - if (payload.rendezvousInformation & kRendezvousInformationNone) { + if (payload.rendezvousInformation & MTRRendezvousInformationNone) { [humanFlags appendString:@"NONE"]; } else { - if (payload.rendezvousInformation & kRendezvousInformationSoftAP) { + if (payload.rendezvousInformation & MTRRendezvousInformationSoftAP) { [humanFlags appendString:@"SoftAP"]; } - if (payload.rendezvousInformation & kRendezvousInformationBLE) { + if (payload.rendezvousInformation & MTRRendezvousInformationBLE) { if (!humanFlags) { [humanFlags appendString:@", "]; } [humanFlags appendString:@"BLE"]; } - if (payload.rendezvousInformation & kRendezvousInformationOnNetwork) { + if (payload.rendezvousInformation & MTRRendezvousInformationOnNetwork) { if (!humanFlags) { [humanFlags appendString:@", "]; } @@ -119,14 +119,14 @@ NSLog(@"SerialNumber: %@", payload.serialNumber); } NSError * error; - NSArray * optionalVendorData = [payload getAllOptionalVendorData:&error]; + NSArray * optionalVendorData = [payload getAllOptionalVendorData:&error]; if (error) { LogNSError("Error: ", error); return CHIP_ERROR_INTERNAL; } - for (const CHIPOptionalQRCodeInfo * info : optionalVendorData) { - bool isTypeString = [info.infoType isEqual:@(kOptionalQRCodeInfoTypeString)]; - bool isTypeInt32 = [info.infoType isEqual:@(kOptionalQRCodeInfoTypeInt32)]; + for (const MTROptionalQRCodeInfo * info : optionalVendorData) { + bool isTypeString = [info.infoType isEqual:@(MTROptionalQRCodeInfoTypeString)]; + bool isTypeInt32 = [info.infoType isEqual:@(MTROptionalQRCodeInfoTypeInt32)]; VerifyOrReturnError(isTypeString || isTypeInt32, CHIP_ERROR_INVALID_ARGUMENT); if (isTypeString) { diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h index 985f1918eef178..453fba5a22a7b4 100644 --- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h +++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h @@ -28,11 +28,9 @@ #include #include #include -#include #import -#import "MTRDevice_Externs.h" #import "MTRError_Utils.h" class TestCommandBridge; @@ -123,21 +121,20 @@ class TestCommandBridge : public CHIPCommandBridge, // will just hand it right back to us without establishing a new CASE // session. if (GetDevice(identity) != nil) { - [GetDevice(identity) invalidateCASESession]; mConnectedDevices[identity] = nil; } - [controller getDevice:value.nodeId - queue:mCallbackQueue - completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) { - if (error != nil) { - SetCommandExitStatus(error); - return; - } - - mConnectedDevices[identity] = device; - NextTest(); - }]; + [controller getBaseDevice:value.nodeId + queue:mCallbackQueue + completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) { + if (error != nil) { + SetCommandExitStatus(error); + return; + } + + mConnectedDevices[identity] = device; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -179,7 +176,7 @@ class TestCommandBridge : public CHIPCommandBridge, return CHIP_NO_ERROR; } - MTRDevice * _Nullable GetDevice(const char * _Nullable identity) { return mConnectedDevices[identity]; } + MTRBaseDevice * _Nullable GetDevice(const char * _Nullable identity) { return mConnectedDevices[identity]; } // PairingDeleted and PairingComplete need to be public so our pairing // delegate can call them. @@ -461,7 +458,7 @@ class TestCommandBridge : public CHIPCommandBridge, TestPairingDelegate * _Nonnull mPairingDelegate; // Set of our connected devices, keyed by identity. - std::map mConnectedDevices; + std::map mConnectedDevices; }; NS_ASSUME_NONNULL_BEGIN diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 21a06554127044..1bd639bfd0502a 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -41,12 +41,12 @@ public: ClusterCommand::AddArguments(); } - CHIP_ERROR SendCommand(MTRDevice * device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) command ({{asHex code 8}}) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTR{{asUpperCamelCase clusterName}} * cluster = [[MTR{{asUpperCamelCase clusterName}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + MTRBaseCluster{{asUpperCamelCase clusterName}} * cluster = [[MTRBaseCluster{{asUpperCamelCase clusterName}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; __auto_type * params = [[MTR{{asUpperCamelCase clusterName}}Cluster{{asUpperCamelCase name}}Params alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; {{#chip_cluster_command_arguments}} @@ -106,12 +106,12 @@ public: { } - CHIP_ERROR SendCommand(MTRDevice * device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) ReadAttribute ({{asHex code 8}}) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTR{{asUpperCamelCase parent.name}} * cluster = [[MTR{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + MTRBaseCluster{{asUpperCamelCase parent.name}} * cluster = [[MTRBaseCluster{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; {{#if_is_fabric_scoped_struct type}} MTRReadParams * params = [[MTRReadParams alloc] init]; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; @@ -157,13 +157,13 @@ public: { } - CHIP_ERROR SendCommand(MTRDevice * device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) WriteAttribute ({{asHex code 8}}) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTR{{asUpperCamelCase parent.name}} * cluster = [[MTR{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + MTRBaseCluster{{asUpperCamelCase parent.name}} * cluster = [[MTRBaseCluster{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; MTRWriteParams * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; {{#if_chip_complex}} {{asObjectiveCType type parent.name}} value; @@ -211,16 +211,16 @@ public: { } - CHIP_ERROR SendCommand(MTRDevice * device, chip::EndpointId endpointId) override + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) ReportAttribute ({{asHex code 8}}) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - MTR{{asUpperCamelCase parent.name}} * cluster = [[MTR{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + MTRBaseCluster{{asUpperCamelCase parent.name}} * cluster = [[MTRBaseCluster{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribe{{>attribute}}WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + [cluster subscribe{{>attribute}}WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:^(){ mSubscriptionEstablished=YES; } reportHandler:^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error) { @@ -245,7 +245,7 @@ public: void registerCluster{{asUpperCamelCase name}}(Commands & commands) { using namespace chip::app::Clusters::{{asUpperCamelCase name}}; - + const char * clusterName = "{{asUpperCamelCase name}}"; commands_list clusterCommands = { diff --git a/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc-src.zapt b/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc-src.zapt deleted file mode 100644 index bd3ec81e32920d..00000000000000 --- a/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc-src.zapt +++ /dev/null @@ -1,69 +0,0 @@ -{{> header}} -#import - -#import - -#import "zap-generated/cluster/MTRTestClustersObjc.h" -#import "MTRCallbackBridge_internal.h" -#import "MTRDevice_Externs.h" -#import "MTRCluster_Externs.h" -#import "zap-generated/CHIPClusters.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using chip::Callback::Callback; -using chip::Callback::Cancelable; -using namespace chip::app::Clusters; - -{{#chip_client_clusters includeAll=true}} - -@interface MTRTest{{asUpperCamelCase name}} () -// Must only touch cppCluster on the Matter queue. -@property (readonly) chip::Controller::{{asUpperCamelCase name}}Cluster * cppCluster; -@end - -@implementation MTRTest{{asUpperCamelCase name}} - -- (chip::Controller::{{asUpperCamelCase name}}Cluster **) cppClusterSlot -{ - return &_cppCluster; -} - -{{#chip_server_cluster_attributes}} -{{#unless isWritableAttribute}} -{{#*inline "attribute"}}Attribute{{asUpperCamelCase name}}{{/inline}} -{{#*inline "callbackName"}}DefaultSuccess{{/inline}} -- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value completionHandler:(StatusCompletion)completionHandler -{ - new MTR{{>callbackName}}CallbackBridge(self.callbackQueue, - {{! For now, don't change the bridge API; instead just use an adapter - to invoke our completion handler. This is not great from a - type-safety perspective, of course. }} - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = {{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; - TypeInfo::Type cppValue; - {{>encode_value target="cppValue" source="value" cluster=parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} - auto successFn = Callback<{{>callbackName}}CallbackType>::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster->WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -{{/unless}} -{{/chip_server_cluster_attributes}} - -@end - -{{/chip_client_clusters}} diff --git a/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc.zapt b/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc.zapt deleted file mode 100644 index caedee02099c57..00000000000000 --- a/examples/darwin-framework-tool/templates/tests/MTRTestClustersObjc.zapt +++ /dev/null @@ -1,27 +0,0 @@ -{{> header}} - -#import - -@class MTRDevice; - -NS_ASSUME_NONNULL_BEGIN - -{{#chip_client_clusters includeAll=true}} - -/** - * Cluster {{name}} - * {{description}} - */ -@interface MTRTest{{asUpperCamelCase name}} : MTR{{asUpperCamelCase name}} - -{{#chip_server_cluster_attributes}} -{{#unless isWritableAttribute}} -- (void)writeAttribute{{asUpperCamelCase name}}WithValue:({{asObjectiveCType type parent.name}})value completionHandler:(StatusCompletion)completionHandler; -{{/unless}} -{{/chip_server_cluster_attributes}} - -@end - -{{/chip_client_clusters}} - -NS_ASSUME_NONNULL_END diff --git a/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt b/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt index 73669801d59441..3a0bb571dbfc95 100644 --- a/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt +++ b/examples/darwin-framework-tool/templates/tests/partials/test_cluster.zapt @@ -133,8 +133,8 @@ class {{filename}}: public TestCommandBridge {{/chip_tests_item_parameters}} return {{command}}("{{identity}}", value); {{else}} - MTRDevice * device = GetDevice("{{identity}}"); - MTRTest{{asUpperCamelCase cluster}} * cluster = [[MTRTest{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:mCallbackQueue]; + MTRBaseDevice * device = GetDevice("{{identity}}"); + MTRBaseCluster{{asUpperCamelCase cluster}} * cluster = [[MTRBaseCluster{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); {{#if isCommand}} @@ -156,7 +156,7 @@ class {{filename}}: public TestCommandBridge {{/chip_tests_item_parameters}} MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; [cluster subscribeAttribute{{asUpperCamelCase attribute}}WithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] - maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] params:params subscriptionEstablished:^{ VerifyOrReturn(testSendCluster{{parent.filename}}_{{waitForReport.index}}_{{asUpperCamelCase waitForReport.command}}_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); diff --git a/examples/darwin-framework-tool/templates/tests/templates.json b/examples/darwin-framework-tool/templates/tests/templates.json index 0f8ea363c7e80e..4dad82fe395a2b 100644 --- a/examples/darwin-framework-tool/templates/tests/templates.json +++ b/examples/darwin-framework-tool/templates/tests/templates.json @@ -49,16 +49,6 @@ "path": "commands.zapt", "name": "Tests Commands header", "output": "test/Commands.h" - }, - { - "path": "MTRTestClustersObjc.zapt", - "name": "Test Objc API Header", - "output": "cluster/MTRTestClustersObjc.h" - }, - { - "path": "MTRTestClustersObjc-src.zapt", - "name": "Test Objc API", - "output": "cluster/MTRTestClustersObjc.mm" } ] } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 98b2c3b01af5c6..cb390ccb3a7d7d 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -175,7 +175,6 @@ efr32_executable("light_switch_app") { "${examples_plat_dir}/init_efrPlatform.cpp", "${examples_plat_dir}/matter_config.cpp", "src/AppTask.cpp", - "src/LightingManager.cpp", "src/ZclCallbacks.cpp", "src/binding-handler.cpp", "src/main.cpp", diff --git a/examples/light-switch-app/efr32/include/AppTask.h b/examples/light-switch-app/efr32/include/AppTask.h index be75aff4df2de9..8b500a94e305d4 100644 --- a/examples/light-switch-app/efr32/include/AppTask.h +++ b/examples/light-switch-app/efr32/include/AppTask.h @@ -19,18 +19,26 @@ #pragma once +/********************************************************** + * Includes + *********************************************************/ + #include #include #include "AppEvent.h" -#include "LightingManager.h" -#include "sl_simple_button_instances.h" - #include "FreeRTOS.h" +#include "sl_simple_button_instances.h" #include "timers.h" // provides FreeRTOS timer support +#include #include +#include #include +/********************************************************** + * Defines + *********************************************************/ + // Application-defined error codes in the CHIP_ERROR space. #define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) #define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) @@ -39,38 +47,157 @@ #define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) #define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) +/********************************************************** + * AppTask Declaration + *********************************************************/ + class AppTask { public: + /********************************************************** + * Public Function Declaration + *********************************************************/ + + /** + * @brief Create AppTask task and Event Queue + * If an error occurs during creation, application will hang after printing out error code + * + * @return CHIP_ERROR CHIP_NO_ERROR if no errors + */ CHIP_ERROR StartAppTask(); + + /** + * @brief AppTask task main loop function + * + * @param pvParameter FreeRTOS task parameter + */ static void AppTaskMain(void * pvParameter); - void PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction); + /** + * @brief PostEvent function that add event to AppTask queue for processing + * + * @param event AppEvent to post + */ void PostEvent(const AppEvent * event); + /** + * @brief Event handler when a button is pressed + * Function posts an event for button processing + * + * @param buttonHandle APP_LIGHT_SWITCH or APP_FUNCTION_BUTTON + * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, + * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED + */ void ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction); + /** + * @brief Callback called by the identify-server when an identify command is received + * + * @param identify identify structure the command applies on + */ + static void OnIdentifyStart(Identify * identify); + + /** + * @brief Callback called by the identify-server when an identify command is stopped or finished + * + * @param identify identify structure the command applies on + */ + static void OnIdentifyStop(Identify * identify); + + /** + * @brief Function called to start the LED light timer + */ + void StartLightTimer(void); + + /** + * @brief Function to stop LED light timer + * Turns off Status LED before stopping timer + */ + void CancelLightTimer(void); + private: + /********************************************************** + * Private Function Declaration + *********************************************************/ + friend AppTask & GetAppTask(void); + /** + * @brief AppTask initialisation function + * + * @return CHIP_ERROR + */ CHIP_ERROR Init(); - static void ActionInitiated(LightingManager::Action_t aAction, int32_t aActor); - static void ActionCompleted(LightingManager::Action_t aAction); - - void CancelTimer(void); - + /** + * @brief Function called to start the function timer + * + * @param aTimeoutMs timer duration in ms + */ + void StartFunctionTimer(uint32_t aTimeoutMs); + + /** + * @brief Function to stop function timer + */ + void CancelFunctionTimer(void); + + /** + * @brief Function call event callback function for processing + * + * @param event triggered event to be processed + */ void DispatchEvent(AppEvent * event); - static void FunctionTimerEventHandler(AppEvent * aEvent); - static void FunctionHandler(AppEvent * aEvent); + /** + * @brief Function Timer finished callback function + * Post an FunctionEventHandler event + * + * @param xTimer timer that finished + */ + static void FunctionTimerEventHandler(TimerHandle_t xTimer); + + /** + * @brief Timer Event processing function + * Trigger factory if Press and Hold duration is respected + * + * @param aEvent post event being processed + */ + static void FunctionEventHandler(AppEvent * aEvent); + + /** + * @brief PB0 Button event processing function + * Press and hold will trigger a factory reset timer start + * Press and release will restart BLEAdvertising if not commisionned + * + * @param aEvent button event being processed + */ + static void ButtonHandler(AppEvent * aEvent); + + /** + * @brief PB1 Button event processing function + * Function triggers a switch action sent to the CHIP task + * + * @param aEvent button event being processed + */ static void SwitchActionEventHandler(AppEvent * aEvent); - static void TimerEventHandler(TimerHandle_t xTimer); - - static void UpdateClusterState(void); - void StartTimer(uint32_t aTimeoutMs); + /** + * @brief Light Timer finished callback function + * Calls LED processing function + * + * @param xTimer timer that finished + */ + static void LightTimerEventHandler(TimerHandle_t xTimer); + + /** + * @brief Updates device LEDs + */ + static void LightEventHandler(); + + /********************************************************** + * Private Attributes declaration + *********************************************************/ enum Function_t { diff --git a/examples/light-switch-app/efr32/include/LightingManager.h b/examples/light-switch-app/efr32/include/LightingManager.h deleted file mode 100644 index 3aa9871e919074..00000000000000 --- a/examples/light-switch-app/efr32/include/LightingManager.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Copyright (c) 2019 Google LLC. - * 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 - -#include "AppEvent.h" - -#include "FreeRTOS.h" -#include "timers.h" // provides FreeRTOS timer support - -#include - -class LightingManager -{ -public: - enum Action_t - { - ON_ACTION = 0, - OFF_ACTION, - - INVALID_ACTION - } Action; - - enum State_t - { - kState_OffInitiated = 0, - kState_OffCompleted, - kState_OnInitiated, - kState_OnCompleted, - } State; - - CHIP_ERROR Init(); - bool IsLightOn(); - void EnableAutoTurnOff(bool aOn); - void SetAutoTurnOffDuration(uint32_t aDurationInSecs); - bool IsActionInProgress(); - bool InitiateAction(int32_t aActor, Action_t aAction); - - typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); - typedef void (*Callback_fn_completed)(Action_t); - void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - -private: - friend LightingManager & LightMgr(void); - State_t mState; - - Callback_fn_initiated mActionInitiated_CB; - Callback_fn_completed mActionCompleted_CB; - - bool mAutoTurnOff; - uint32_t mAutoTurnOffDuration; - bool mAutoTurnOffTimerArmed; - - void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); - - static void TimerEventHandler(TimerHandle_t xTimer); - static void AutoTurnOffTimerEventHandler(AppEvent * aEvent); - static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - - static LightingManager sLight; -}; - -inline LightingManager & LightMgr(void) -{ - return LightingManager::sLight; -} diff --git a/examples/light-switch-app/efr32/src/AppTask.cpp b/examples/light-switch-app/efr32/src/AppTask.cpp index da0e20396ba733..10138fa34a71df 100644 --- a/examples/light-switch-app/efr32/src/AppTask.cpp +++ b/examples/light-switch-app/efr32/src/AppTask.cpp @@ -17,6 +17,10 @@ * limitations under the License. */ +/********************************************************** + * Includes + *********************************************************/ + #include "AppTask.h" #include "AppConfig.h" #include "AppEvent.h" @@ -34,31 +38,31 @@ #include #include #include -#include #include #include #include - #include - +#include +#include +#include #include #include -#include - -#include - -#include #if CHIP_ENABLE_OPENTHREAD #include #include #include -#endif +#endif // CHIP_ENABLE_OPENTHREAD + #ifdef SL_WIFI #include "wfx_host_events.h" #include #include -#endif /* SL_WIFI */ +#endif // SL_WIFI + +/********************************************************** + * Defines and Constants + *********************************************************/ #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -68,7 +72,7 @@ #define EXAMPLE_VENDOR_ID 0xcafe #define SYSTEM_STATE_LED &sl_led_led0 -#define LIGHT_LED &sl_led_led1 + #define APP_FUNCTION_BUTTON &sl_button_btn0 #define APP_LIGHT_SWITCH &sl_button_btn1 @@ -76,7 +80,13 @@ using namespace chip; using namespace ::chip::DeviceLayer; namespace { + +/********************************************************** + * Variable declarations + *********************************************************/ + TimerHandle_t sFunctionTimer; // FreeRTOS app sw timer. +TimerHandle_t sLightTimer; TaskHandle_t sAppTaskHandle; QueueHandle_t sAppEventQueue; @@ -84,20 +94,19 @@ QueueHandle_t sAppEventQueue; LEDWidget sStatusLED; #ifdef SL_WIFI -bool sIsWiFiProvisioned = false; -bool sIsWiFiEnabled = false; -bool sIsWiFiAttached = false; - app::Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::SlWiFiDriver::GetInstance())); #endif /* SL_WIFI */ -#if CHIP_ENABLE_OPENTHREAD -bool sIsThreadProvisioned = false; -bool sIsThreadEnabled = false; -#endif /* CHIP_ENABLE_OPENTHREAD */ +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + +bool sIsProvisioned = false; +bool sIsEnabled = false; +bool sIsAttached = false; bool sHaveBLEConnections = false; +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED + EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; uint8_t sAppEventQueueBuffer[APP_EVENT_QUEUE_SIZE * sizeof(AppEvent)]; @@ -106,15 +115,25 @@ StaticQueue_t sAppEventQueueStruct; StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; +/********************************************************** + * Identify Callbacks + *********************************************************/ + namespace { void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) { + ChipLogProgress(Zcl, "Trigger Identify Complete"); sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + GetAppTask().CancelLightTimer(); +#endif } } // namespace void OnTriggerIdentifyEffect(Identify * identify) { + ChipLogProgress(Zcl, "Trigger Identify Effect"); sIdentifyEffect = identify->mCurrentEffectIdentifier; if (identify->mCurrentEffectIdentifier == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE) @@ -124,6 +143,10 @@ void OnTriggerIdentifyEffect(Identify * identify) sIdentifyEffect = static_cast(identify->mEffectVariant); } +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + GetAppTask().StartLightTimer(); +#endif + switch (sIdentifyEffect) { case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: @@ -147,16 +170,20 @@ void OnTriggerIdentifyEffect(Identify * identify) } Identify gIdentify = { - chip::EndpointId{ 1 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, + chip::EndpointId{ 1 }, GetAppTask().OnIdentifyStart, + GetAppTask().OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerIdentifyEffect, }; + } // namespace + using namespace chip::TLV; using namespace ::chip::DeviceLayer; +/********************************************************** + * AppTask Definitions + *********************************************************/ + AppTask AppTask::sAppTask; CHIP_ERROR AppTask::StartAppTask() @@ -170,7 +197,12 @@ CHIP_ERROR AppTask::StartAppTask() // Start App task. sAppTaskHandle = xTaskCreateStatic(AppTaskMain, APP_TASK_NAME, ArraySize(appStack), NULL, 1, appStack, &appTaskStruct); - return (sAppTaskHandle == nullptr) ? APP_ERROR_CREATE_TASK_FAILED : CHIP_NO_ERROR; + if (sAppTaskHandle == nullptr) + { + EFR32_LOG("Failed to create app task"); + appError(APP_ERROR_CREATE_TASK_FAILED); + } + return CHIP_NO_ERROR; } CHIP_ERROR AppTask::Init() @@ -193,11 +225,11 @@ CHIP_ERROR AppTask::Init() #endif // Create FreeRTOS sw timer for Function Selection. - sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel - 1, // == default timer period (mS) - false, // no timer reload (==one-shot) - (void *) this, // init timer id = app task obj context - TimerEventHandler // timer callback handler + sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel + 1, // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = app task obj context + FunctionTimerEventHandler // timer callback handler ); if (sFunctionTimer == NULL) { @@ -205,20 +237,23 @@ CHIP_ERROR AppTask::Init() appError(APP_ERROR_CREATE_TIMER_FAILED); } - EFR32_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); - err = LightMgr().Init(); - if (err != CHIP_NO_ERROR) + // Create FreeRTOS sw timer for LED Management. + sLightTimer = xTimerCreate("LightTmr", // Text Name + 10, // Default timer period (mS) + true, // reload timer + (void *) this, // Timer Id + LightTimerEventHandler // Timer callback handler + ); + if (sLightTimer == NULL) { - EFR32_LOG("LightMgr().Init() failed"); - appError(err); + EFR32_LOG("Light Timer create failed"); + appError(APP_ERROR_CREATE_TIMER_FAILED); } - LightMgr().SetCallbacks(ActionInitiated, ActionCompleted); + EFR32_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); - // Initialize LEDs LEDWidget::InitGpio(); sStatusLED.Init(SYSTEM_STATE_LED); - UpdateClusterState(); ConfigurationMgr().LogDeviceConfig(); @@ -262,84 +297,38 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } - EFR32_LOG("App Task started"); +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + sAppTask.StartLightTimer(); +#endif + EFR32_LOG("App Task started"); while (true) { - BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); + BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); while (eventReceived == pdTRUE) { sAppTask.DispatchEvent(&event); eventReceived = xQueueReceive(sAppEventQueue, &event, 0); } + } +} - // Collect connectivity and configuration state from the CHIP stack. Because - // the CHIP event loop is being run in a separate task, the stack must be - // locked while these values are queried. However we use a non-blocking - // lock request (TryLockCHIPStack()) to avoid blocking other UI activities - // when the CHIP task is busy (e.g. with a long crypto operation). - if (PlatformMgr().TryLockChipStack()) - { -#ifdef SL_WIFI - sIsWiFiProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); - sIsWiFiEnabled = ConnectivityMgr().IsWiFiStationEnabled(); - sIsWiFiAttached = ConnectivityMgr().IsWiFiStationConnected(); -#endif /* SL_WIFI */ -#if CHIP_ENABLE_OPENTHREAD - sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); - sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); -#endif /* CHIP_ENABLE_OPENTHREAD */ - sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); - PlatformMgr().UnlockChipStack(); - } +void AppTask::OnIdentifyStart(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStart"); - // Update the status LED if factory reset has not been initiated. - // - // If system has "full connectivity", keep the LED On constantly. - // - // If thread and service provisioned, but not attached to the thread network - // yet OR no connectivity to the service OR subscriptions are not fully - // established THEN blink the LED Off for a short period of time. - // - // If the system has ble connection(s) uptill the stage above, THEN blink - // the LEDs at an even rate of 100ms. - // - // Otherwise, blink the LED ON for a very short time. - if (sAppTask.mFunction != kFunction_FactoryReset) - { - if (gIdentify.mActive) - { - sStatusLED.Blink(250, 250); - } - if (sIdentifyEffect != EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT) - { - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK) - { - sStatusLED.Blink(50, 50); - } - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE) - { - sStatusLED.Blink(1000, 1000); - } - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY) - { - sStatusLED.Blink(300, 700); - } - } -#if CHIP_ENABLE_OPENTHREAD - if (sIsThreadProvisioned && sIsThreadEnabled) -#else - if (sIsWiFiProvisioned && sIsWiFiEnabled && !sIsWiFiAttached) -#endif - { - sStatusLED.Blink(950, 50); - } - else if (sHaveBLEConnections) { sStatusLED.Blink(100, 100); } - else { sStatusLED.Blink(50, 950); } - } +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StartLightTimer(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +} - sStatusLED.Animate(); - } +void AppTask::OnIdentifyStop(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStop"); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.CancelLightTimer(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED } void AppTask::SwitchActionEventHandler(AppEvent * aEvent) @@ -372,21 +361,26 @@ void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAc } else if (buttonHandle == APP_FUNCTION_BUTTON) { - button_event.Handler = FunctionHandler; + button_event.Handler = ButtonHandler; sAppTask.PostEvent(&button_event); } } -void AppTask::TimerEventHandler(TimerHandle_t xTimer) +void AppTask::FunctionTimerEventHandler(TimerHandle_t xTimer) { AppEvent event; event.Type = AppEvent::kEventType_Timer; event.TimerEvent.Context = (void *) xTimer; - event.Handler = FunctionTimerEventHandler; + event.Handler = FunctionEventHandler; sAppTask.PostEvent(&event); } -void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) +void AppTask::LightTimerEventHandler(TimerHandle_t xTimer) +{ + sAppTask.LightEventHandler(); +} + +void AppTask::FunctionEventHandler(AppEvent * aEvent) { if (aEvent->Type != AppEvent::kEventType_Timer) { @@ -401,7 +395,11 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) // Start timer for FACTORY_RESET_CANCEL_WINDOW_TIMEOUT to allow user to // cancel, if required. - sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + sAppTask.StartFunctionTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StartLightTimer(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED sAppTask.mFunction = kFunction_FactoryReset; @@ -414,11 +412,100 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) { // Actually trigger Factory Reset sAppTask.mFunction = kFunction_NoneSelected; + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.CancelLightTimer(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED + chip::Server::GetInstance().ScheduleFactoryReset(); } } -void AppTask::FunctionHandler(AppEvent * aEvent) +void AppTask::LightEventHandler() +{ + // Collect connectivity and configuration state from the CHIP stack. Because + // the CHIP event loop is being run in a separate task, the stack must be + // locked while these values are queried. However we use a non-blocking + // lock request (TryLockCHIPStack()) to avoid blocking other UI activities + // when the CHIP task is busy (e.g. with a long crypto operation). +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + if (PlatformMgr().TryLockChipStack()) + { +#ifdef SL_WIFI + sIsProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); + sIsEnabled = ConnectivityMgr().IsWiFiStationEnabled(); + sIsAttached = ConnectivityMgr().IsWiFiStationConnected(); +#endif /* SL_WIFI */ +#if CHIP_ENABLE_OPENTHREAD + sIsProvisioned = ConnectivityMgr().IsThreadProvisioned(); + sIsEnabled = ConnectivityMgr().IsThreadEnabled(); + sIsAttached = ConnectivityMgr().IsThreadAttached(); +#endif /* CHIP_ENABLE_OPENTHREAD */ + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); + PlatformMgr().UnlockChipStack(); + } +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED + + // Update the status LED if factory reset has not been initiated. + // + // If system has "full connectivity", keep the LED On constantly. + // + // If thread and service provisioned, but not attached to the thread network + // yet OR no connectivity to the service OR subscriptions are not fully + // established THEN blink the LED Off for a short period of time. + // + // If the system has ble connection(s) uptill the stage above, THEN blink + // the LEDs at an even rate of 100ms. + // + // Otherwise, blink the LED ON for a very short time. + if (sAppTask.mFunction != kFunction_FactoryReset) + { + if (gIdentify.mActive) + { + sStatusLED.Blink(250, 250); + } + else if (sIdentifyEffect != EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT) + { + if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK) + { + sStatusLED.Blink(50, 50); + } + if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE) + { + sStatusLED.Blink(1000, 1000); + } + if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY) + { + sStatusLED.Blink(300, 700); + } + } +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + else if (sIsProvisioned && sIsEnabled) + { + if (sIsAttached) + { + sStatusLED.Set(true); + } + else + { + sStatusLED.Blink(950, 50); + } + } + else if (sHaveBLEConnections) + { + sStatusLED.Blink(100, 100); + } + else + { + sStatusLED.Blink(50, 950); + } +#endif // CHIP_DEVICE_CONFIG_ENABLE_SED + } + + sStatusLED.Animate(); +} + +void AppTask::ButtonHandler(AppEvent * aEvent) { // To trigger software update: press the APP_FUNCTION_BUTTON button briefly (< // FACTORY_RESET_TRIGGER_TIMEOUT) To initiate factory reset: press the @@ -431,7 +518,7 @@ void AppTask::FunctionHandler(AppEvent * aEvent) { if (!sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_NoneSelected) { - sAppTask.StartTimer(FACTORY_RESET_TRIGGER_TIMEOUT); + sAppTask.StartFunctionTimer(FACTORY_RESET_TRIGGER_TIMEOUT); sAppTask.mFunction = kFunction_StartBleAdv; } } @@ -440,7 +527,7 @@ void AppTask::FunctionHandler(AppEvent * aEvent) // If the button was released before factory reset got initiated, start BLE advertissement in fast mode if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_StartBleAdv) { - sAppTask.CancelTimer(); + sAppTask.CancelFunctionTimer(); sAppTask.mFunction = kFunction_NoneSelected; #ifdef SL_WIFI @@ -455,10 +542,23 @@ void AppTask::FunctionHandler(AppEvent * aEvent) } else { EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); } } + else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) + { + sAppTask.CancelFunctionTimer(); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.CancelLightTimer(); +#endif + + // Change the function to none selected since factory reset has been + // canceled. + sAppTask.mFunction = kFunction_NoneSelected; + EFR32_LOG("Factory Reset has been Canceled"); + } } } -void AppTask::CancelTimer() +void AppTask::CancelFunctionTimer() { if (xTimerStop(sFunctionTimer, 0) == pdFAIL) { @@ -469,12 +569,22 @@ void AppTask::CancelTimer() mFunctionTimerActive = false; } -void AppTask::StartTimer(uint32_t aTimeoutInMs) +void AppTask::CancelLightTimer() +{ + sStatusLED.Set(false); + if (xTimerStop(sLightTimer, 100) != pdPASS) + { + EFR32_LOG("Light Time start failed"); + appError(APP_ERROR_START_TIMER_FAILED); + } +} + +void AppTask::StartFunctionTimer(uint32_t aTimeoutInMs) { if (xTimerIsTimerActive(sFunctionTimer)) { EFR32_LOG("app timer already started!"); - CancelTimer(); + CancelFunctionTimer(); } // timer is not active, change its period to required value (== restart). @@ -489,20 +599,12 @@ void AppTask::StartTimer(uint32_t aTimeoutInMs) mFunctionTimerActive = true; } -void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) -{ - if (aActor == AppEvent::kEventType_Button) - { - sAppTask.mSyncClusterToButtonAction = true; - } -} - -void AppTask::ActionCompleted(LightingManager::Action_t aAction) +void AppTask::StartLightTimer() { - if (sAppTask.mSyncClusterToButtonAction) + if (pdPASS != xTimerStart(sLightTimer, 0)) { - UpdateClusterState(); - sAppTask.mSyncClusterToButtonAction = false; + EFR32_LOG("Light Time start failed"); + appError(APP_ERROR_START_TIMER_FAILED); } } @@ -530,7 +632,9 @@ void AppTask::PostEvent(const AppEvent * aEvent) } if (!status) + { EFR32_LOG("Failed to post event to app task event queue"); + } } else { @@ -549,5 +653,3 @@ void AppTask::DispatchEvent(AppEvent * aEvent) EFR32_LOG("Event received with no handler. Dropping event."); } } - -void AppTask::UpdateClusterState(void) {} diff --git a/examples/light-switch-app/efr32/src/LightingManager.cpp b/examples/light-switch-app/efr32/src/LightingManager.cpp deleted file mode 100644 index 7b206fd1ab6f37..00000000000000 --- a/examples/light-switch-app/efr32/src/LightingManager.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * 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 "LightingManager.h" - -#include "AppConfig.h" -#include "AppTask.h" -#include - -LightingManager LightingManager::sLight; - -TimerHandle_t sLightTimer; - -CHIP_ERROR LightingManager::Init() -{ - // Create FreeRTOS sw timer for light timer. - sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel - 1, // == default timer period (mS) - false, // no timer reload (==one-shot) - (void *) this, // init timer id = light obj context - TimerEventHandler // timer callback handler - ); - - if (sLightTimer == NULL) - { - EFR32_LOG("sLightTimer timer create failed"); - return APP_ERROR_CREATE_TIMER_FAILED; - } - - mState = kState_OffCompleted; - mAutoTurnOffTimerArmed = false; - mAutoTurnOff = false; - mAutoTurnOffDuration = 0; - - return CHIP_NO_ERROR; -} - -void LightingManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) -{ - mActionInitiated_CB = aActionInitiated_CB; - mActionCompleted_CB = aActionCompleted_CB; -} - -bool LightingManager::IsActionInProgress() -{ - return (mState == kState_OffInitiated || mState == kState_OnInitiated); -} - -bool LightingManager::IsLightOn() -{ - return (mState == kState_OnCompleted); -} - -void LightingManager::EnableAutoTurnOff(bool aOn) -{ - mAutoTurnOff = aOn; -} - -void LightingManager::SetAutoTurnOffDuration(uint32_t aDurationInSecs) -{ - mAutoTurnOffDuration = aDurationInSecs; -} - -bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction) -{ - bool action_initiated = false; - State_t new_state; - - // Initiate Turn On/Off Action only when the previous one is complete. - if (mState == kState_OffCompleted && aAction == ON_ACTION) - { - action_initiated = true; - - new_state = kState_OnInitiated; - } - else if (mState == kState_OnCompleted && aAction == OFF_ACTION) - { - action_initiated = true; - - new_state = kState_OffInitiated; - } - - if (action_initiated) - { - if (mAutoTurnOffTimerArmed && new_state == kState_OffInitiated) - { - // If auto turn off timer has been armed and someone initiates turning off, - // cancel the timer and continue as normal. - mAutoTurnOffTimerArmed = false; - - CancelTimer(); - } - - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); - - // Since the timer started successfully, update the state and trigger callback - mState = new_state; - - if (mActionInitiated_CB) - { - mActionInitiated_CB(aAction, aActor); - } - } - - return action_initiated; -} - -void LightingManager::StartTimer(uint32_t aTimeoutMs) -{ - if (xTimerIsTimerActive(sLightTimer)) - { - EFR32_LOG("app timer already started!"); - CancelTimer(); - } - - // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ticks if the change period command - // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS) - { - EFR32_LOG("sLightTimer timer start() failed"); - appError(APP_ERROR_START_TIMER_FAILED); - } -} - -void LightingManager::CancelTimer(void) -{ - if (xTimerStop(sLightTimer, 0) == pdFAIL) - { - EFR32_LOG("sLightTimer stop() failed"); - appError(APP_ERROR_STOP_TIMER_FAILED); - } -} - -void LightingManager::TimerEventHandler(TimerHandle_t xTimer) -{ - // Get light obj context from timer id. - LightingManager * light = static_cast(pvTimerGetTimerID(xTimer)); - - // The timer event handler will be called in the context of the timer task - // once sLightTimer expires. Post an event to apptask queue with the actual handler - // so that the event can be handled in the context of the apptask. - AppEvent event; - event.Type = AppEvent::kEventType_Timer; - event.TimerEvent.Context = light; - if (light->mAutoTurnOffTimerArmed) - { - event.Handler = AutoTurnOffTimerEventHandler; - } - else - { - event.Handler = ActuatorMovementTimerEventHandler; - } - GetAppTask().PostEvent(&event); -} - -void LightingManager::AutoTurnOffTimerEventHandler(AppEvent * aEvent) -{ - LightingManager * light = static_cast(aEvent->TimerEvent.Context); - int32_t actor = 0; - - // Make sure auto turn off timer is still armed. - if (!light->mAutoTurnOffTimerArmed) - { - return; - } - - light->mAutoTurnOffTimerArmed = false; - - EFR32_LOG("Auto Turn Off has been triggered!"); - - light->InitiateAction(actor, OFF_ACTION); -} - -void LightingManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) -{ - Action_t actionCompleted = INVALID_ACTION; - - LightingManager * light = static_cast(aEvent->TimerEvent.Context); - - if (light->mState == kState_OffInitiated) - { - light->mState = kState_OffCompleted; - actionCompleted = OFF_ACTION; - } - else if (light->mState == kState_OnInitiated) - { - light->mState = kState_OnCompleted; - actionCompleted = ON_ACTION; - } - - if (actionCompleted != INVALID_ACTION) - { - if (light->mActionCompleted_CB) - { - light->mActionCompleted_CB(actionCompleted); - } - - if (light->mAutoTurnOff && actionCompleted == ON_ACTION) - { - // Start the timer for auto turn off - light->StartTimer(light->mAutoTurnOffDuration * 1000); - - light->mAutoTurnOffTimerArmed = true; - - EFR32_LOG("Auto Turn off enabled. Will be triggered in %u seconds", light->mAutoTurnOffDuration); - } - } -} diff --git a/examples/light-switch-app/efr32/src/ZclCallbacks.cpp b/examples/light-switch-app/efr32/src/ZclCallbacks.cpp index 6dad9e5923e5a0..52542ca88fb390 100644 --- a/examples/light-switch-app/efr32/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/efr32/src/ZclCallbacks.cpp @@ -21,7 +21,6 @@ */ #include "AppConfig.h" -#include "LightingManager.h" #include #include diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 2fd22feee58276..ae8c31908036ca 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -83,6 +83,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h index 10563ef351f037..746bef6f595222 100644 --- a/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h @@ -144,13 +144,6 @@ */ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" -/** - * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS - * - * Enable recording UTC timestamps. - */ -#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - /** * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE * diff --git a/examples/lighting-app/esp32/README.md b/examples/lighting-app/esp32/README.md index 2e8d1548db3570..eae01ad14d2978 100644 --- a/examples/lighting-app/esp32/README.md +++ b/examples/lighting-app/esp32/README.md @@ -10,6 +10,7 @@ This example demonstrates the Matter Lighting application on ESP platforms. - [Commissioning over BLE using chip-tool](#commissioning-over-ble-using-chip-tool) - [Cluster Control](#cluster-control) - [Steps to Try Lighting app OTA Requestor](#steps-to-try-lighting-app-ota-requestor) +- [Flash Encryption](#flash-encryption) --- @@ -255,3 +256,50 @@ type below query. Once the transfer is complete, OTA requestor sends ApplyUpdateRequest command to OTA provider for applying the image. Device will restart on successful application of OTA image. + +# Flash encryption + +Below is the quick start guide for encrypting the application and factory +partition but before proceeding further please READ THE DOCS FIRST. +Documentation References: + +- [Flash Encryption](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/security/flash-encryption.html) +- [NVS Encryption](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_flash.html#nvs-encryption) + +## Enable flash encryption and some factory settings using `idf.py menuconfig` + +- Enable the Flash encryption [Security features → Enable flash encryption on + boot] +- Use `partitions_encrypted.csv` partition table [Partition Table → Custom + partition CSV file] +- Enable ESP32 Factory Data Provider [Component config → CHIP Device Layer → + Commissioning options → Use ESP32 Factory Data Provider] +- Enable ESP32 Device Instance Info Provider [Component config → CHIP Device + Layer → Commissioning options → Use ESP32 Device Instance Info Provider] + +## Generate the factory partition using `generate_esp32_chip_factory_bin.py` script + +- Please provide `-e` option along with other options to generate the + encrypted factory partition +- Two partition binaries will be generated `factory_partition.bin` and + `keys/nvs_key_partition.bin` + +## Flashing the application, factory partition, and nvs keys + +- Flash the application using `idf.py flash`, NOTE: If not flashing for the + first time you will have to use `idf.py encrypted-flash` + +- Flash the factory partition, this SHALL be non encrypted write as NVS + encryption works differently + +``` +esptool.py -p (PORT) write_flash 0x9000 path/to/factory_partition.bin +``` + +- Encrypted flash the nvs keys partition + +``` +esptool.py -p (PORT) write_flash --encrypt 0x317000 path/to/nvs_key_partition.bin +``` + +NOTE: Above command uses the default addressed printed in the boot logs diff --git a/examples/lighting-app/esp32/partitions_encrypted.csv b/examples/lighting-app/esp32/partitions_encrypted.csv new file mode 100644 index 00000000000000..807ee35dc8e645 --- /dev/null +++ b/examples/lighting-app/esp32/partitions_encrypted.csv @@ -0,0 +1,8 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs, , 0x6000, +otadata, data, ota, , 0x2000, encrypted +phy_init, data, phy, , 0x1000, encrypted +ota_0, app, ota_0, , 1500K, encrypted +ota_1, app, ota_1, , 1500K, encrypted +nvs_key, data, nvs_keys,, 0x1000, encrypted diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 2f92c3f0d1d8f6..67b8e0386adecb 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -48,6 +48,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/lighting-app/p6/BUILD.gn b/examples/lighting-app/p6/BUILD.gn index fddb3e14405e60..d0762e7a1acea9 100644 --- a/examples/lighting-app/p6/BUILD.gn +++ b/examples/lighting-app/p6/BUILD.gn @@ -41,10 +41,10 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = + "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 63910c7755ef7c..4745c5d1f26f55 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -65,6 +65,7 @@ qpg_executable("lighting_app") { ":sdk", "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/lighting-app/lighting-common:color-format", + "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index 13e526024c1edf..c05c40c0f282c7 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -40,6 +40,7 @@ #include +#include #include #include @@ -71,6 +72,7 @@ StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; +chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; /********************************************************** * Identify Callbacks @@ -127,7 +129,6 @@ Identify gIdentify = { /********************************************************** * OffWithEffect Callbacks *********************************************************/ - void OnTriggerOffWithEffect(OnOffEffect * effect) { chip::app::Clusters::OnOff::OnOffEffectIdentifier effectId = effect->mEffectIdentifier; @@ -231,6 +232,10 @@ CHIP_ERROR AppTask::Init() // Init ZCL Data Model static chip::CommonCaseDeviceServerInitParams initParams; (void) initParams.InitializeStaticResourcesBeforeServerInit(); + + gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; nativeParams.lockCb = LockOpenThreadTask; nativeParams.unlockCb = UnlockOpenThreadTask; diff --git a/examples/lighting-app/tizen/BUILD.gn b/examples/lighting-app/tizen/BUILD.gn index b45574db92b349..dac62cb04f346a 100644 --- a/examples/lighting-app/tizen/BUILD.gn +++ b/examples/lighting-app/tizen/BUILD.gn @@ -21,10 +21,6 @@ import("${tizen_sdk_build_root}/tizen_sdk.gni") assert(chip_build_tools) -config("includes") { - include_dirs = [ "include" ] -} - executable("chip-lighting-app") { sources = [ "include/CHIPProjectAppConfig.h", diff --git a/examples/lighting-app/tizen/src/main.cpp b/examples/lighting-app/tizen/src/main.cpp index fde7338d5582f0..5c9ba03b675bd1 100644 --- a/examples/lighting-app/tizen/src/main.cpp +++ b/examples/lighting-app/tizen/src/main.cpp @@ -36,12 +36,14 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & } } +void ApplicationInit() {} + int main(int argc, char * argv[]) { TizenServiceAppMain app; - app.Init(argc, argv); + VerifyOrDie(app.Init(argc, argv) == 0); - LightingMgr().Init(); + VerifyOrDie(LightingMgr().Init() == CHIP_NO_ERROR); return app.RunMainLoop(); } diff --git a/examples/lock-app/efr32/src/LockManager.cpp b/examples/lock-app/efr32/src/LockManager.cpp index b59b15b57c4110..ab9e548562981e 100644 --- a/examples/lock-app/efr32/src/LockManager.cpp +++ b/examples/lock-app/efr32/src/LockManager.cpp @@ -406,11 +406,7 @@ bool LockManager::GetCredential(chip::EndpointId endpointId, uint16_t credential EmberAfPluginDoorLockCredentialInfo & credential) { - VerifyOrReturnValue(credentialIndex > 0, false); // indices are one-indexed - - credentialIndex--; - - VerifyOrReturnValue(IsValidCredentialIndex(credentialIndex, credentialType), false); + VerifyOrReturnValue(IsValidCredentialIndex(--credentialIndex, credentialType), false); // indices are one-indexed ChipLogProgress(Zcl, "Lock App: LockManager::GetCredential [credentialType=%u], credentialIndex=%d", to_underlying(credentialType), credentialIndex); @@ -453,11 +449,7 @@ bool LockManager::SetCredential(chip::EndpointId endpointId, uint16_t credential const chip::ByteSpan & credentialData) { - VerifyOrReturnValue(credentialIndex > 0, false); // indices are one-indexed - - credentialIndex--; - - VerifyOrReturnValue(IsValidCredentialIndex(credentialIndex, credentialType), false); + VerifyOrReturnValue(IsValidCredentialIndex(--credentialIndex, credentialType), false); // indices are one-indexed ChipLogProgress(Zcl, "Door Lock App: LockManager::SetCredential " @@ -635,23 +627,6 @@ const char * LockManager::lockStateToString(DlLockState lockState) const bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockState, const Optional & pin, DlOperationError & err) { - DlLockState curState = DlLockState::kLocked; - if (mState == kState_UnlockCompleted) - curState = DlLockState::kUnlocked; - - if ((curState == lockState) && (curState == DlLockState::kLocked)) - { - ChipLogDetail(Zcl, "Door Lock App: door is already locked, ignoring command to set lock state to \"%s\" [endpointId=%d]", - lockStateToString(lockState), endpointId); - return true; - } - else if ((curState == lockState) && (curState == DlLockState::kUnlocked)) - { - ChipLogDetail(Zcl, - "Door Lock App: door is already unlocked, ignoring command to set unlock state to \"%s\" [endpointId=%d]", - lockStateToString(lockState), endpointId); - return true; - } // Assume pin is required until told otherwise bool requirePin = true; @@ -661,14 +636,12 @@ bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockStat if (!pin.HasValue()) { ChipLogDetail(Zcl, "Door Lock App: PIN code is not specified, but it is required [endpointId=%d]", mEndpointId); - curState = lockState; // If a pin code is not required if (!requirePin) { ChipLogDetail(Zcl, "Door Lock App: setting door lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), endpointId); - curState = lockState; return true; } @@ -690,8 +663,6 @@ bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockStat "Lock App: specified PIN code was found in the database, setting lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), mEndpointId); - curState = lockState; - return true; } } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 8068d529281045..f3fea5b77f892a 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -42,6 +42,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -445,7 +449,7 @@ server cluster PowerSourceConfiguration = 46 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -472,7 +476,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -497,7 +501,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -510,14 +514,14 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; - readonly attribute int32u wiredAssessedCurrent = 6; - readonly attribute enum8 batteryChargeLevel = 14; - readonly attribute boolean batteryReplacementNeeded = 15; - readonly attribute enum8 batteryReplaceability = 16; - readonly attribute char_string<60> batteryReplacementDescription = 19; + readonly attribute nullable int32u wiredAssessedCurrent = 6; + readonly attribute BatChargeLevel batChargeLevel = 14; + readonly attribute boolean batReplacementNeeded = 15; + readonly attribute BatReplaceability batReplaceability = 16; + readonly attribute char_string<60> batReplacementDescription = 19; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -2234,10 +2238,10 @@ endpoint 1 { ram attribute status default = 1; ram attribute order default = 1; ram attribute description default = "Battery"; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; - ram attribute batteryReplacementDescription; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; + ram attribute batReplacementDescription; ram attribute featureMap default = 0x0A; ram attribute clusterRevision default = 1; } diff --git a/examples/lock-app/p6/BUILD.gn b/examples/lock-app/p6/BUILD.gn index f7eb7fb05fe233..8e9e65e6de0006 100644 --- a/examples/lock-app/p6/BUILD.gn +++ b/examples/lock-app/p6/BUILD.gn @@ -38,10 +38,10 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = + "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index 01ad495b722385..60bdcd4bf75ced 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -63,6 +63,7 @@ qpg_executable("lock_app") { deps = [ ":sdk", "${chip_root}/examples/lock-app/lock-common", + "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index a27d99fc3a6373..ab03f02efcc35e 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -37,6 +37,7 @@ #include +#include #include #include @@ -68,6 +69,8 @@ StaticQueue_t sAppEventQueueStruct; StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; + +chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; } // namespace AppTask AppTask::sAppTask; @@ -131,6 +134,10 @@ CHIP_ERROR AppTask::Init() // Init ZCL Data Model static chip::CommonCaseDeviceServerInitParams initParams; (void) initParams.InitializeStaticResourcesBeforeServerInit(); + + gExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; nativeParams.lockCb = LockOpenThreadTask; nativeParams.unlockCb = UnlockOpenThreadTask; diff --git a/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h b/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h index b6c15f4c98230e..d5a80499d4c94b 100644 --- a/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h +++ b/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h @@ -32,3 +32,16 @@ // Allows app options (ports) to be configured on launch of app #define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/ota-requestor-app/p6/BUILD.gn b/examples/ota-requestor-app/p6/BUILD.gn index 7701ca1c5e8a41..f3f1a6b944ad19 100644 --- a/examples/ota-requestor-app/p6/BUILD.gn +++ b/examples/ota-requestor-app/p6/BUILD.gn @@ -40,10 +40,10 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = + "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 3c58323e2df60d..d294fde5d4cddf 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -37,6 +37,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -541,7 +545,7 @@ server cluster PowerSourceConfiguration = 46 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -568,7 +572,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -593,7 +597,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -606,37 +610,37 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; - readonly attribute int32u wiredAssessedInputVoltage = 3; - readonly attribute int16u wiredAssessedInputFrequency = 4; - readonly attribute enum8 wiredCurrentType = 5; - readonly attribute int32u wiredAssessedCurrent = 6; + readonly attribute nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute WiredCurrentType wiredCurrentType = 5; + readonly attribute nullable int32u wiredAssessedCurrent = 6; readonly attribute int32u wiredNominalVoltage = 7; readonly attribute int32u wiredMaximumCurrent = 8; readonly attribute boolean wiredPresent = 9; - readonly attribute ENUM8 activeWiredFaults[] = 10; - readonly attribute int32u batteryVoltage = 11; - readonly attribute int8u batteryPercentRemaining = 12; - readonly attribute int32u batteryTimeRemaining = 13; - readonly attribute enum8 batteryChargeLevel = 14; - readonly attribute boolean batteryReplacementNeeded = 15; - readonly attribute enum8 batteryReplaceability = 16; - readonly attribute boolean batteryPresent = 17; - readonly attribute ENUM8 activeBatteryFaults[] = 18; - readonly attribute char_string<60> batteryReplacementDescription = 19; - readonly attribute int32u batteryCommonDesignation = 20; - readonly attribute char_string<20> batteryANSIDesignation = 21; - readonly attribute char_string<20> batteryIECDesignation = 22; - readonly attribute int32u batteryApprovedChemistry = 23; - readonly attribute int32u batteryCapacity = 24; - readonly attribute int8u batteryQuantity = 25; - readonly attribute enum8 batteryChargeState = 26; - readonly attribute int32u batteryTimeToFullCharge = 27; - readonly attribute boolean batteryFunctionalWhileCharging = 28; - readonly attribute int32u batteryChargingCurrent = 29; - readonly attribute ENUM8 activeBatteryChargeFaults[] = 30; + readonly attribute WiredFault activeWiredFaults[] = 10; + readonly attribute nullable int32u batVoltage = 11; + readonly attribute nullable int8u batPercentRemaining = 12; + readonly attribute nullable int32u batTimeRemaining = 13; + readonly attribute BatChargeLevel batChargeLevel = 14; + readonly attribute boolean batReplacementNeeded = 15; + readonly attribute BatReplaceability batReplaceability = 16; + readonly attribute boolean batPresent = 17; + readonly attribute BatFault activeBatFaults[] = 18; + readonly attribute char_string<60> batReplacementDescription = 19; + readonly attribute int32u batCommonDesignation = 20; + readonly attribute char_string<20> batANSIDesignation = 21; + readonly attribute char_string<20> batIECDesignation = 22; + readonly attribute int32u batApprovedChemistry = 23; + readonly attribute int32u batCapacity = 24; + readonly attribute int8u batQuantity = 25; + readonly attribute BatChargeState batChargeState = 26; + readonly attribute nullable int32u batTimeToFullCharge = 27; + readonly attribute boolean batFunctionalWhileCharging = 28; + readonly attribute nullable int32u batChargingCurrent = 29; + readonly attribute BatChargeFault activeBatChargeFaults[] = 30; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -2667,26 +2671,26 @@ endpoint 0 { ram attribute wiredMaximumCurrent; ram attribute wiredPresent; callback attribute activeWiredFaults; - ram attribute batteryVoltage; - ram attribute batteryPercentRemaining; - ram attribute batteryTimeRemaining; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; - ram attribute batteryPresent; - callback attribute activeBatteryFaults; - ram attribute batteryReplacementDescription; - ram attribute batteryCommonDesignation; - ram attribute batteryANSIDesignation; - ram attribute batteryIECDesignation; - ram attribute batteryApprovedChemistry; - ram attribute batteryCapacity; - ram attribute batteryQuantity; - ram attribute batteryChargeState; - ram attribute batteryTimeToFullCharge; - ram attribute batteryFunctionalWhileCharging; - ram attribute batteryChargingCurrent; - callback attribute activeBatteryChargeFaults; + ram attribute batVoltage; + ram attribute batPercentRemaining; + ram attribute batTimeRemaining; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; + ram attribute batPresent; + callback attribute activeBatFaults; + ram attribute batReplacementDescription; + ram attribute batCommonDesignation; + ram attribute batANSIDesignation; + ram attribute batIECDesignation; + ram attribute batApprovedChemistry; + ram attribute batCapacity; + ram attribute batQuantity; + ram attribute batChargeState; + ram attribute batTimeToFullCharge; + ram attribute batFunctionalWhileCharging; + ram attribute batChargingCurrent; + callback attribute activeBatChargeFaults; ram attribute featureMap; ram attribute clusterRevision default = 1; } diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 8ad332d5c6c6ab..6dbef1dca7c2ed 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -1035,7 +1035,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1115,7 +1115,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1207,7 +1207,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -1223,7 +1223,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -1239,7 +1239,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -1255,11 +1255,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1271,7 +1271,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -1287,11 +1287,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1303,7 +1303,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -1319,7 +1319,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -1335,7 +1335,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -1351,7 +1351,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -1367,7 +1367,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -1383,7 +1383,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -1399,7 +1399,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -1415,7 +1415,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -1431,7 +1431,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -1447,11 +1447,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1463,7 +1463,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -1479,7 +1479,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -1495,7 +1495,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -1511,7 +1511,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -4048,7 +4048,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4224,7 +4224,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 3c58323e2df60d..d294fde5d4cddf 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -37,6 +37,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -541,7 +545,7 @@ server cluster PowerSourceConfiguration = 46 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -568,7 +572,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -593,7 +597,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -606,37 +610,37 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; - readonly attribute int32u wiredAssessedInputVoltage = 3; - readonly attribute int16u wiredAssessedInputFrequency = 4; - readonly attribute enum8 wiredCurrentType = 5; - readonly attribute int32u wiredAssessedCurrent = 6; + readonly attribute nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute WiredCurrentType wiredCurrentType = 5; + readonly attribute nullable int32u wiredAssessedCurrent = 6; readonly attribute int32u wiredNominalVoltage = 7; readonly attribute int32u wiredMaximumCurrent = 8; readonly attribute boolean wiredPresent = 9; - readonly attribute ENUM8 activeWiredFaults[] = 10; - readonly attribute int32u batteryVoltage = 11; - readonly attribute int8u batteryPercentRemaining = 12; - readonly attribute int32u batteryTimeRemaining = 13; - readonly attribute enum8 batteryChargeLevel = 14; - readonly attribute boolean batteryReplacementNeeded = 15; - readonly attribute enum8 batteryReplaceability = 16; - readonly attribute boolean batteryPresent = 17; - readonly attribute ENUM8 activeBatteryFaults[] = 18; - readonly attribute char_string<60> batteryReplacementDescription = 19; - readonly attribute int32u batteryCommonDesignation = 20; - readonly attribute char_string<20> batteryANSIDesignation = 21; - readonly attribute char_string<20> batteryIECDesignation = 22; - readonly attribute int32u batteryApprovedChemistry = 23; - readonly attribute int32u batteryCapacity = 24; - readonly attribute int8u batteryQuantity = 25; - readonly attribute enum8 batteryChargeState = 26; - readonly attribute int32u batteryTimeToFullCharge = 27; - readonly attribute boolean batteryFunctionalWhileCharging = 28; - readonly attribute int32u batteryChargingCurrent = 29; - readonly attribute ENUM8 activeBatteryChargeFaults[] = 30; + readonly attribute WiredFault activeWiredFaults[] = 10; + readonly attribute nullable int32u batVoltage = 11; + readonly attribute nullable int8u batPercentRemaining = 12; + readonly attribute nullable int32u batTimeRemaining = 13; + readonly attribute BatChargeLevel batChargeLevel = 14; + readonly attribute boolean batReplacementNeeded = 15; + readonly attribute BatReplaceability batReplaceability = 16; + readonly attribute boolean batPresent = 17; + readonly attribute BatFault activeBatFaults[] = 18; + readonly attribute char_string<60> batReplacementDescription = 19; + readonly attribute int32u batCommonDesignation = 20; + readonly attribute char_string<20> batANSIDesignation = 21; + readonly attribute char_string<20> batIECDesignation = 22; + readonly attribute int32u batApprovedChemistry = 23; + readonly attribute int32u batCapacity = 24; + readonly attribute int8u batQuantity = 25; + readonly attribute BatChargeState batChargeState = 26; + readonly attribute nullable int32u batTimeToFullCharge = 27; + readonly attribute boolean batFunctionalWhileCharging = 28; + readonly attribute nullable int32u batChargingCurrent = 29; + readonly attribute BatChargeFault activeBatChargeFaults[] = 30; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -2667,26 +2671,26 @@ endpoint 0 { ram attribute wiredMaximumCurrent; ram attribute wiredPresent; callback attribute activeWiredFaults; - ram attribute batteryVoltage; - ram attribute batteryPercentRemaining; - ram attribute batteryTimeRemaining; - ram attribute batteryChargeLevel; - ram attribute batteryReplacementNeeded; - ram attribute batteryReplaceability; - ram attribute batteryPresent; - callback attribute activeBatteryFaults; - ram attribute batteryReplacementDescription; - ram attribute batteryCommonDesignation; - ram attribute batteryANSIDesignation; - ram attribute batteryIECDesignation; - ram attribute batteryApprovedChemistry; - ram attribute batteryCapacity; - ram attribute batteryQuantity; - ram attribute batteryChargeState; - ram attribute batteryTimeToFullCharge; - ram attribute batteryFunctionalWhileCharging; - ram attribute batteryChargingCurrent; - callback attribute activeBatteryChargeFaults; + ram attribute batVoltage; + ram attribute batPercentRemaining; + ram attribute batTimeRemaining; + ram attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; + ram attribute batPresent; + callback attribute activeBatFaults; + ram attribute batReplacementDescription; + ram attribute batCommonDesignation; + ram attribute batANSIDesignation; + ram attribute batIECDesignation; + ram attribute batApprovedChemistry; + ram attribute batCapacity; + ram attribute batQuantity; + ram attribute batChargeState; + ram attribute batTimeToFullCharge; + ram attribute batFunctionalWhileCharging; + ram attribute batChargingCurrent; + callback attribute activeBatChargeFaults; ram attribute featureMap; ram attribute clusterRevision default = 1; } diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 8ad332d5c6c6ab..6dbef1dca7c2ed 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -1035,7 +1035,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1115,7 +1115,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "WiredCurrentType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1207,7 +1207,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -1223,7 +1223,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -1239,7 +1239,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -1255,11 +1255,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1271,7 +1271,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementNeeded", + "name": "BatReplacementNeeded", "code": 15, "mfgCode": null, "side": "server", @@ -1287,11 +1287,11 @@ "reportableChange": 0 }, { - "name": "BatteryReplaceability", + "name": "BatReplaceability", "code": 16, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatReplaceability", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1303,7 +1303,7 @@ "reportableChange": 0 }, { - "name": "BatteryPresent", + "name": "BatPresent", "code": 17, "mfgCode": null, "side": "server", @@ -1319,7 +1319,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -1335,7 +1335,7 @@ "reportableChange": 0 }, { - "name": "BatteryReplacementDescription", + "name": "BatReplacementDescription", "code": 19, "mfgCode": null, "side": "server", @@ -1351,7 +1351,7 @@ "reportableChange": 0 }, { - "name": "BatteryCommonDesignation", + "name": "BatCommonDesignation", "code": 20, "mfgCode": null, "side": "server", @@ -1367,7 +1367,7 @@ "reportableChange": 0 }, { - "name": "BatteryANSIDesignation", + "name": "BatANSIDesignation", "code": 21, "mfgCode": null, "side": "server", @@ -1383,7 +1383,7 @@ "reportableChange": 0 }, { - "name": "BatteryIECDesignation", + "name": "BatIECDesignation", "code": 22, "mfgCode": null, "side": "server", @@ -1399,7 +1399,7 @@ "reportableChange": 0 }, { - "name": "BatteryApprovedChemistry", + "name": "BatApprovedChemistry", "code": 23, "mfgCode": null, "side": "server", @@ -1415,7 +1415,7 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", + "name": "BatCapacity", "code": 24, "mfgCode": null, "side": "server", @@ -1431,7 +1431,7 @@ "reportableChange": 0 }, { - "name": "BatteryQuantity", + "name": "BatQuantity", "code": 25, "mfgCode": null, "side": "server", @@ -1447,11 +1447,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1463,7 +1463,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeToFullCharge", + "name": "BatTimeToFullCharge", "code": 27, "mfgCode": null, "side": "server", @@ -1479,7 +1479,7 @@ "reportableChange": 0 }, { - "name": "BatteryFunctionalWhileCharging", + "name": "BatFunctionalWhileCharging", "code": 28, "mfgCode": null, "side": "server", @@ -1495,7 +1495,7 @@ "reportableChange": 0 }, { - "name": "BatteryChargingCurrent", + "name": "BatChargingCurrent", "code": 29, "mfgCode": null, "side": "server", @@ -1511,7 +1511,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryChargeFaults", + "name": "ActiveBatChargeFaults", "code": 30, "mfgCode": null, "side": "server", @@ -4048,7 +4048,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4224,7 +4224,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/platform/tizen/TizenServiceAppMain.cpp b/examples/platform/tizen/TizenServiceAppMain.cpp index 06f90928b99c9a..b174abcfd78e2a 100644 --- a/examples/platform/tizen/TizenServiceAppMain.cpp +++ b/examples/platform/tizen/TizenServiceAppMain.cpp @@ -45,8 +45,6 @@ void service_app_control(app_control_h app_control, void * data) } }; // namespace -void ApplicationInit() {} - int TizenServiceAppMain::Init(int argc, char ** argv) { mArgc = argc; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 3d73fcb846aa86..da69099d90f4d1 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -77,6 +77,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 747e411838c834..ebf643296e65f0 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 @@ -42,6 +42,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index f39ee1a95c9252..c899c4af42fba7 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -51,6 +51,10 @@ server cluster Identify = 3 { } server cluster Groups = 4 { + bitmap GroupClusterFeature : BITMAP32 { + kGroupNames = 0x1; + } + readonly attribute bitmap8 nameSupport = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -547,7 +551,7 @@ server cluster UnitLocalization = 45 { } server cluster PowerSource = 47 { - enum BatChargeFaultType : ENUM8 { + enum BatChargeFault : ENUM8 { kUnspecfied = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -574,7 +578,7 @@ server cluster PowerSource = 47 { kIsNotCharging = 3; } - enum BatFaultType : ENUM8 { + enum BatFault : ENUM8 { kUnspecfied = 0; kOverTemp = 1; kUnderTemp = 2; @@ -599,7 +603,7 @@ server cluster PowerSource = 47 { kDc = 1; } - enum WiredFaultType : ENUM8 { + enum WiredFault : ENUM8 { kUnspecfied = 0; kOverVoltage = 1; kUnderVoltage = 2; @@ -612,15 +616,15 @@ server cluster PowerSource = 47 { kReplaceable = 0x8; } - readonly attribute enum8 status = 0; + readonly attribute PowerSourceStatus status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; - readonly attribute int32u batteryVoltage = 11; - readonly attribute int8u batteryPercentRemaining = 12; - readonly attribute int32u batteryTimeRemaining = 13; - readonly attribute enum8 batteryChargeLevel = 14; - readonly attribute ENUM8 activeBatteryFaults[] = 18; - readonly attribute enum8 batteryChargeState = 26; + readonly attribute nullable int32u batVoltage = 11; + readonly attribute nullable int8u batPercentRemaining = 12; + readonly attribute nullable int32u batTimeRemaining = 13; + readonly attribute BatChargeLevel batChargeLevel = 14; + readonly attribute BatFault activeBatFaults[] = 18; + readonly attribute BatChargeState batChargeState = 26; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } @@ -1669,12 +1673,12 @@ endpoint 0 { ram attribute status; ram attribute order; ram attribute description; - ram attribute batteryVoltage; - ram attribute batteryPercentRemaining; - ram attribute batteryTimeRemaining; - ram attribute batteryChargeLevel; - callback attribute activeBatteryFaults; - ram attribute batteryChargeState; + ram attribute batVoltage; + ram attribute batPercentRemaining; + ram attribute batTimeRemaining; + ram attribute batChargeLevel; + callback attribute activeBatFaults; + ram attribute batChargeState; ram attribute featureMap; ram attribute clusterRevision default = 1; } diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 6d97a2b6a54e9e..3a85ea58e04356 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 71, + "featureLevel": 72, "creator": "zap", "keyValuePairs": [ { @@ -90,7 +90,7 @@ "commands": [], "attributes": [ { - "name": "IdentifyTime", + "name": "identify time", "code": 0, "mfgCode": null, "side": "server", @@ -106,7 +106,7 @@ "reportableChange": 0 }, { - "name": "IdentifyType", + "name": "identify type", "code": 1, "mfgCode": null, "side": "server", @@ -322,7 +322,7 @@ ], "attributes": [ { - "name": "NameSupport", + "name": "name support", "code": 0, "mfgCode": null, "side": "server", @@ -792,7 +792,7 @@ "commands": [], "attributes": [ { - "name": "DeviceList", + "name": "device list", "code": 0, "mfgCode": null, "side": "server", @@ -808,7 +808,7 @@ "reportableChange": 0 }, { - "name": "ServerList", + "name": "server list", "code": 1, "mfgCode": null, "side": "server", @@ -824,7 +824,7 @@ "reportableChange": 0 }, { - "name": "ClientList", + "name": "client list", "code": 2, "mfgCode": null, "side": "server", @@ -840,7 +840,7 @@ "reportableChange": 0 }, { - "name": "PartsList", + "name": "parts list", "code": 3, "mfgCode": null, "side": "server", @@ -2404,7 +2404,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "PowerSourceStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2448,7 +2448,7 @@ "reportableChange": 0 }, { - "name": "BatteryVoltage", + "name": "BatVoltage", "code": 11, "mfgCode": null, "side": "server", @@ -2464,7 +2464,7 @@ "reportableChange": 0 }, { - "name": "BatteryPercentRemaining", + "name": "BatPercentRemaining", "code": 12, "mfgCode": null, "side": "server", @@ -2480,7 +2480,7 @@ "reportableChange": 0 }, { - "name": "BatteryTimeRemaining", + "name": "BatTimeRemaining", "code": 13, "mfgCode": null, "side": "server", @@ -2496,11 +2496,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeLevel", + "name": "BatChargeLevel", "code": 14, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeLevel", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2512,7 +2512,7 @@ "reportableChange": 0 }, { - "name": "ActiveBatteryFaults", + "name": "ActiveBatFaults", "code": 18, "mfgCode": null, "side": "server", @@ -2528,11 +2528,11 @@ "reportableChange": 0 }, { - "name": "BatteryChargeState", + "name": "BatChargeState", "code": 26, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BatChargeState", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6209,7 +6209,7 @@ "commands": [], "attributes": [ { - "name": "IdentifyTime", + "name": "identify time", "code": 0, "mfgCode": null, "side": "server", @@ -6225,7 +6225,7 @@ "reportableChange": 0 }, { - "name": "IdentifyType", + "name": "identify type", "code": 1, "mfgCode": null, "side": "server", @@ -6441,7 +6441,7 @@ ], "attributes": [ { - "name": "NameSupport", + "name": "name support", "code": 0, "mfgCode": null, "side": "server", @@ -6919,7 +6919,7 @@ "commands": [], "attributes": [ { - "name": "DeviceList", + "name": "device list", "code": 0, "mfgCode": null, "side": "server", @@ -6935,7 +6935,7 @@ "reportableChange": 0 }, { - "name": "ServerList", + "name": "server list", "code": 1, "mfgCode": null, "side": "server", @@ -6951,7 +6951,7 @@ "reportableChange": 0 }, { - "name": "ClientList", + "name": "client list", "code": 2, "mfgCode": null, "side": "server", @@ -6967,7 +6967,7 @@ "reportableChange": 0 }, { - "name": "PartsList", + "name": "parts list", "code": 3, "mfgCode": null, "side": "server", @@ -7439,7 +7439,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7615,7 +7615,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7753,7 +7753,7 @@ "commands": [], "attributes": [ { - "name": "IdentifyTime", + "name": "identify time", "code": 0, "mfgCode": null, "side": "server", @@ -7769,7 +7769,7 @@ "reportableChange": 0 }, { - "name": "IdentifyType", + "name": "identify type", "code": 1, "mfgCode": null, "side": "server", @@ -7985,7 +7985,7 @@ ], "attributes": [ { - "name": "NameSupport", + "name": "name support", "code": 0, "mfgCode": null, "side": "server", @@ -8463,7 +8463,7 @@ "commands": [], "attributes": [ { - "name": "DeviceList", + "name": "device list", "code": 0, "mfgCode": null, "side": "server", @@ -8479,7 +8479,7 @@ "reportableChange": 0 }, { - "name": "ServerList", + "name": "server list", "code": 1, "mfgCode": null, "side": "server", @@ -8495,7 +8495,7 @@ "reportableChange": 0 }, { - "name": "ClientList", + "name": "client list", "code": 2, "mfgCode": null, "side": "server", @@ -8511,7 +8511,7 @@ "reportableChange": 0 }, { - "name": "PartsList", + "name": "parts list", "code": 3, "mfgCode": null, "side": "server", @@ -8983,7 +8983,7 @@ "code": 10, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OperationalStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9159,7 +9159,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "SafetyStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9283,6 +9283,5 @@ "endpointVersion": 2, "deviceIdentifier": 514 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index f5f6608a2add91..044253e57eb63b 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 3d0d22900b0f5c..83bd2d971ccb81 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index d46e775750b1d8..46c7bc7ab9ccf6 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -28,7 +28,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -45,7 +45,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -62,7 +62,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -79,7 +79,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.79" + - name: "connectedhomeip/chip-build-vscode:0.5.84" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index cc43e37e3989ee..878c07d204ef77 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -259,6 +259,10 @@ def HostTargets(): app_targets.append(target.Extend('tv-casting-app', app=HostApp.TV_CASTING)) app_targets.append(target.Extend('bridge', app=HostApp.BRIDGE)) + nodeps_args = dict(enable_ble=False, enable_wifi=False, enable_thread=False, use_clang=True) + app_targets.append(target.Extend('chip-tool-nodeps', app=HostApp.CHIP_TOOL, **nodeps_args)) + app_targets.append(target.Extend('all-clusters-app-nodeps', app=HostApp.ALL_CLUSTERS, **nodeps_args)) + builder = VariantBuilder() # Possible build variants. Note that number of potential @@ -290,6 +294,10 @@ def HostTargets(): for target in builder.AllVariants(): yield target + # limited subset for coverage + yield target_native.Extend('all-clusters-coverage', app=HostApp.ALL_CLUSTERS, use_coverage=True) + yield target_native.Extend('chip-tool-coverage', app=HostApp.CHIP_TOOL, use_coverage=True) + # Without extra build variants yield target_native.Extend('chip-cert', app=HostApp.CERT_TOOL) yield target_native.Extend('address-resolve-tool', app=HostApp.ADDRESS_RESOLVE) @@ -300,13 +308,11 @@ def HostTargets(): yield target_native.Extend('address-resolve-tool-platform-mdns-ipv6only', app=HostApp.ADDRESS_RESOLVE, use_platform_mdns=True, enable_ipv4=False).GlobBlacklist("Reduce default build variants") - nodeps_args = dict(enable_ipv4=False, enable_ble=False, enable_wifi=False, enable_thread=False) - yield target_native.Extend('chip-tool-nodeps', app=HostApp.CHIP_TOOL, **nodeps_args) - yield target_native.Extend('all-clusters-app-nodeps', app=HostApp.ALL_CLUSTERS, **nodeps_args) + yield target_native.Extend('tests', app=HostApp.TESTS) + yield target_native.Extend('tests-coverage', app=HostApp.TESTS, use_coverage=True) + yield target_native.Extend('tests-clang', app=HostApp.TESTS, use_clang=True) test_target = Target(HostBoard.NATIVE.PlatformName(), HostBuilder) - yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests', board=HostBoard.NATIVE, app=HostApp.TESTS) - yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests-clang', board=HostBoard.NATIVE, app=HostApp.TESTS, use_clang=True) yield test_target.Extend(HostBoard.FAKE.BoardName() + '-tests', board=HostBoard.FAKE, app=HostApp.TESTS) @@ -557,6 +563,8 @@ def TizenTargets(): target = Target('tizen-arm', TizenBuilder, board=TizenBoard.ARM) + builder.targets.append(target.Extend('all-clusters', app=TizenApp.ALL_CLUSTERS)) + builder.targets.append(target.Extend('all-clusters-minimal', app=TizenApp.ALL_CLUSTERS_MINIMAL)) builder.targets.append(target.Extend('chip-tool', app=TizenApp.CHIP_TOOL)) builder.targets.append(target.Extend('light', app=TizenApp.LIGHT)) diff --git a/scripts/build/build_darwin_framework.py b/scripts/build/build_darwin_framework.py new file mode 100644 index 00000000000000..51e26b7d044a3c --- /dev/null +++ b/scripts/build/build_darwin_framework.py @@ -0,0 +1,63 @@ +#!/usr/bin/env -S python3 -B +# Copyright (c) 2022 Project Matter 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 argparse +import os +import subprocess + + +def run_command(command): + print("Running {}".format(command)) + return str(subprocess.check_output(command.split())) + + +def build_darwin_framework(args): + abs_path = os.path.abspath(args.out_path) + if not os.path.exists(abs_path): + os.mkdir(abs_path) + + command = "xcodebuild -target {target} -sdk macosx -project {project} CONFIGURATION_BUILD_DIR={outpath}".format( + target=args.target, project=args.project_path, outpath=abs_path) + command_result = run_command(command) + + print("Build Framework Result: {}".format(command_result)) + with open(args.log_path, "w") as f: + f.write(command_result) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Build the Matter Darwin framework") + parser.add_argument( + "--project_path", + default="src/darwin/Framework/Matter.xcodeproj", + help="Set the project path", + required=True, + ) + parser.add_argument( + "--out_path", + default="/tmp/macos_framework_output", + help="Output lpath for framework", + required=True, + ) + parser.add_argument("--target", + default="Matter", + help="Name of target to build", + required=True) + parser.add_argument("--log_path", + help="Output log file destination", + required=True) + + args = parser.parse_args() + build_darwin_framework(args) diff --git a/scripts/build/builders/gn.py b/scripts/build/builders/gn.py index ef4b67e9a4af28..1c00bf1c1e9d89 100644 --- a/scripts/build/builders/gn.py +++ b/scripts/build/builders/gn.py @@ -45,6 +45,14 @@ def GnBuildEnv(self): """ return None + def PreBuildCommand(self): + """Extra steps to run before 'build'""" + pass + + def PostBuildCommand(self): + """Extra steps to run after 'build'""" + pass + def generate(self): if not os.path.exists(self.output_dir): cmd = [ @@ -75,8 +83,12 @@ def generate(self): self._Execute(cmd, title=title) def _build(self): + self.PreBuildCommand() + cmd = ['ninja', '-C', self.output_dir] if self.build_command: cmd.append(self.build_command) self._Execute(cmd, title='Building ' + self.identifier) + + self.PostBuildCommand() diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 1f487259ca2972..3c071988148384 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -197,7 +197,8 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_thread=True, use_tsan=False, use_asan=False, separate_event_loop=True, use_libfuzzer=False, use_clang=False, interactive_mode=True, extra_tests=False, - use_platform_mdns=False, enable_rpcs=False): + use_platform_mdns=False, enable_rpcs=False, + use_coverage=False): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) @@ -236,6 +237,10 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, if use_libfuzzer: self.extra_gn_options.append('is_libfuzzer=true') + self.use_coverage = use_coverage + if use_coverage: + self.extra_gn_options.append('use_coverage=true') + if use_clang: self.extra_gn_options.append('is_clang=true') @@ -321,6 +326,32 @@ def SysRootPath(self, name): raise Exception('Missing environment variable "%s"' % name) return os.environ[name] + def generate(self): + super(HostBuilder, self).generate() + + if self.app == HostApp.TESTS and self.use_coverage: + self.coverage_dir = os.path.join(self.output_dir, 'coverage') + self._Execute(['mkdir', '-p', self.coverage_dir], title="Create coverage output location") + self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") + + def PreBuildCommand(self): + if self.app == HostApp.TESTS and self.use_coverage: + self._Execute(['ninja', '-C', self.output_dir, 'default'], title="Build-only") + self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") + + def PostBuildCommand(self): + if self.app == HostApp.TESTS and self.use_coverage: + self._Execute(['lcov', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--output-file', + os.path.join(self.coverage_dir, 'lcov_test.info')], title="Update coverage") + self._Execute(['lcov', '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_base.info'), + '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_test.info'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_final.info') + ], title="Final coverage info") + self._Execute(['genhtml', os.path.join(self.coverage_dir, 'lcov_final.info'), '--output-directory', + os.path.join(self.coverage_dir, 'html')], title="HTML coverage") + def build_outputs(self): outputs = {} diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index d6e92114cd2540..106c163991de1a 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -72,9 +72,9 @@ def AppNamePrefix(self): def _FlashBundlePrefix(self): if self == NrfApp.ALL_CLUSTERS: - return 'chip-nrfconnect-all-clusters-example' + return 'chip-nrfconnect-all-clusters-app-example' elif self == NrfApp.ALL_CLUSTERS_MINIMAL: - return 'chip-nrfconnect-all-clusters-minimal-example' + return 'chip-nrfconnect-all-clusters-minimal-app-example' elif self == NrfApp.LIGHT: return 'chip-nrfconnect-lighting-example' elif self == NrfApp.LOCK: diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index 5c8ca690ae4caf..b256018d48accc 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -14,30 +14,38 @@ import logging import os -from enum import Enum, auto +from collections import namedtuple +from enum import Enum from xml.etree import ElementTree as ET from .gn import GnBuilder +App = namedtuple('App', ['name', 'source', 'outputs']) +Board = namedtuple('Board', ['target_cpu']) -class TizenApp(Enum): - - CHIP_TOOL = auto() - LIGHT = auto() - def ExamplePath(self): - if self == TizenApp.CHIP_TOOL: - return 'chip-tool' - elif self == TizenApp.LIGHT: - return 'lighting-app/tizen' - else: - raise Exception('Unknown app type: %r' % self) +class TizenApp(Enum): - def AppName(self): - if self == TizenApp.LIGHT: - return 'chip-lighting-app' - else: - raise Exception('Unknown app type: %r' % self) + ALL_CLUSTERS = App( + 'chip-all-clusters-app', + 'examples/all-clusters-app/tizen', + ('chip-all-clusters-app', + 'chip-all-clusters-app.map')) + ALL_CLUSTERS_MINIMAL = App( + 'chip-all-clusters-minimal-app', + 'examples/all-clusters-minimal-app/tizen', + ('chip-all-clusters-minimal-app', + 'chip-all-clusters-minimal-app.map')) + CHIP_TOOL = App( + 'chip-tool', + 'examples/chip-tool', + ('chip-tool', + 'chip-tool.map')) + LIGHT = App( + 'chip-lighting-app', + 'examples/lighting-app/tizen', + ('chip-lighting-app', + 'chip-lighting-app.map')) def PackageName(self): return self.manifest.get('package') @@ -50,13 +58,8 @@ def parse_manifest(self, manifest: str): class TizenBoard(Enum): - ARM = auto() - def TargetCpuName(self): - if self == TizenBoard.ARM: - return 'arm' - else: - raise Exception('Unknown board type: %r' % self) + ARM = Board('arm') class TizenBuilder(GnBuilder): @@ -72,7 +75,7 @@ def __init__(self, use_tsan: bool = False, ): super(TizenBuilder, self).__init__( - root=os.path.join(root, 'examples', app.ExamplePath()), + root=os.path.join(root, app.value.source), runner=runner) self.app = app @@ -107,22 +110,20 @@ def GnBuildArgs(self): return self.extra_gn_options + [ 'target_os="tizen"', - 'target_cpu="%s"' % self.board.TargetCpuName(), + 'target_cpu="%s"' % self.board.value.target_cpu, 'tizen_sdk_root="%s"' % os.environ['TIZEN_SDK_ROOT'], 'tizen_sdk_sysroot="%s"' % os.environ['TIZEN_SDK_SYSROOT'], ] def _generate_flashbundle(self): logging.info('Packaging %s', self.output_dir) - cmd = ['ninja', '-C', self.output_dir, self.app.AppName() + ':tpk'] + cmd = ['ninja', '-C', self.output_dir, self.app.value.name + ':tpk'] self._Execute(cmd, title='Packaging ' + self.identifier) def build_outputs(self): return { - '%s' % self.app.AppName(): - os.path.join(self.output_dir, self.app.AppName()), - '%s.map' % self.app.AppName(): - os.path.join(self.output_dir, '%s.map' % self.app.AppName()), + output: os.path.join(self.output_dir, output) + for output in self.app.value.outputs } def flashbundle(self): diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 082430b019ac39..31b5c69437dfbc 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -231,6 +231,22 @@ qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light telink-tlsr9518adk80d-light-switch +tizen-arm-all-clusters +tizen-arm-all-clusters-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal +tizen-arm-all-clusters-minimal-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-ble (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-ble-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-ble-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-minimal-no-wifi-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-ble-no-wifi-asan (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-wifi (NOGLOB: Reduce default build variants) +tizen-arm-all-clusters-no-wifi-asan (NOGLOB: Reduce default build variants) tizen-arm-chip-tool tizen-arm-chip-tool-asan (NOGLOB: Reduce default build variants) tizen-arm-chip-tool-no-ble (NOGLOB: Reduce default build variants) diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 321dd96d45721a..0cd4131a107229 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -1114,6 +1114,54 @@ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-light-switch -b tlsr9518adk80d {root}/examples/light-switch-app/telink' +# Generating tizen-arm-all-clusters +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters + +# Generating tizen-arm-all-clusters-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-asan + +# Generating tizen-arm-all-clusters-minimal +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal + +# Generating tizen-arm-all-clusters-minimal-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-asan + +# Generating tizen-arm-all-clusters-minimal-no-ble +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_config_network_layer_ble=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-ble + +# Generating tizen-arm-all-clusters-minimal-no-ble-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_config_network_layer_ble=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-ble-asan + +# Generating tizen-arm-all-clusters-minimal-no-ble-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-ble-no-wifi + +# Generating tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan + +# Generating tizen-arm-all-clusters-minimal-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-wifi + +# Generating tizen-arm-all-clusters-minimal-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-minimal-app/tizen '--args=chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-minimal-no-wifi-asan + +# Generating tizen-arm-all-clusters-no-ble +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble + +# Generating tizen-arm-all-clusters-no-ble-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-asan + +# Generating tizen-arm-all-clusters-no-ble-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-no-wifi + +# Generating tizen-arm-all-clusters-no-ble-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_config_network_layer_ble=false chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-ble-no-wifi-asan + +# Generating tizen-arm-all-clusters-no-wifi +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_enable_wifi=false target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-wifi + +# Generating tizen-arm-all-clusters-no-wifi-asan +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/tizen '--args=chip_enable_wifi=false is_asan=true target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-all-clusters-no-wifi-asan + # Generating tizen-arm-chip-tool gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" tizen_sdk_sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-chip-tool @@ -2232,6 +2280,54 @@ ninja -C {out}/telink-tlsr9518adk80d-light # Building telink-tlsr9518adk80d-light-switch ninja -C {out}/telink-tlsr9518adk80d-light-switch +# Building tizen-arm-all-clusters +ninja -C {out}/tizen-arm-all-clusters + +# Building tizen-arm-all-clusters-asan +ninja -C {out}/tizen-arm-all-clusters-asan + +# Building tizen-arm-all-clusters-minimal +ninja -C {out}/tizen-arm-all-clusters-minimal + +# Building tizen-arm-all-clusters-minimal-asan +ninja -C {out}/tizen-arm-all-clusters-minimal-asan + +# Building tizen-arm-all-clusters-minimal-no-ble +ninja -C {out}/tizen-arm-all-clusters-minimal-no-ble + +# Building tizen-arm-all-clusters-minimal-no-ble-asan +ninja -C {out}/tizen-arm-all-clusters-minimal-no-ble-asan + +# Building tizen-arm-all-clusters-minimal-no-ble-no-wifi +ninja -C {out}/tizen-arm-all-clusters-minimal-no-ble-no-wifi + +# Building tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-minimal-no-ble-no-wifi-asan + +# Building tizen-arm-all-clusters-minimal-no-wifi +ninja -C {out}/tizen-arm-all-clusters-minimal-no-wifi + +# Building tizen-arm-all-clusters-minimal-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-minimal-no-wifi-asan + +# Building tizen-arm-all-clusters-no-ble +ninja -C {out}/tizen-arm-all-clusters-no-ble + +# Building tizen-arm-all-clusters-no-ble-asan +ninja -C {out}/tizen-arm-all-clusters-no-ble-asan + +# Building tizen-arm-all-clusters-no-ble-no-wifi +ninja -C {out}/tizen-arm-all-clusters-no-ble-no-wifi + +# Building tizen-arm-all-clusters-no-ble-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-no-ble-no-wifi-asan + +# Building tizen-arm-all-clusters-no-wifi +ninja -C {out}/tizen-arm-all-clusters-no-wifi + +# Building tizen-arm-all-clusters-no-wifi-asan +ninja -C {out}/tizen-arm-all-clusters-no-wifi-asan + # Building tizen-arm-chip-tool ninja -C {out}/tizen-arm-chip-tool diff --git a/scripts/build/testdata/build_linux_on_x64.txt b/scripts/build/testdata/build_linux_on_x64.txt index 6633aab1c72dbc..f1ffd8c0fc58f0 100644 --- a/scripts/build/testdata/build_linux_on_x64.txt +++ b/scripts/build/testdata/build_linux_on_x64.txt @@ -6,6 +6,16 @@ bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '"'"'--args=target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-all-clusters' +# Generating linux-arm64-all-clusters-app-nodeps +bash -c ' +PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ + gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '"'"'--args=chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-all-clusters-app-nodeps' + +# Generating linux-arm64-all-clusters-app-nodeps-ipv6only +bash -c ' +PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ + gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '"'"'--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-all-clusters-app-nodeps-ipv6only' + # Generating linux-arm64-all-clusters-ipv6only bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ @@ -41,6 +51,16 @@ bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-ipv6only' +# Generating linux-arm64-chip-tool-nodeps +bash -c ' +PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ + gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '"'"'--args=chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-nodeps' + +# Generating linux-arm64-chip-tool-nodeps-ipv6only +bash -c ' +PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ + gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '"'"'--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true target_cpu="arm64" is_clang=true chip_crypto="mbedtls" sysroot="SYSROOT_AARCH64"'"'"' {out}/linux-arm64-chip-tool-nodeps-ipv6only' + # Generating linux-arm64-light bash -c ' PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ @@ -156,7 +176,13 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} {ou gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux {out}/linux-x64-all-clusters # Generating linux-x64-all-clusters-app-nodeps -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false' {out}/linux-x64-all-clusters-app-nodeps +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '--args=chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true' {out}/linux-x64-all-clusters-app-nodeps + +# Generating linux-x64-all-clusters-app-nodeps-ipv6only +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true' {out}/linux-x64-all-clusters-app-nodeps-ipv6only + +# Generating linux-x64-all-clusters-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux --args=use_coverage=true {out}/linux-x64-all-clusters-coverage # Generating linux-x64-all-clusters-ipv6only gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-all-clusters-ipv6only @@ -179,11 +205,17 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '-- # Generating linux-x64-chip-tool gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool {out}/linux-x64-chip-tool +# Generating linux-x64-chip-tool-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool --args=use_coverage=true {out}/linux-x64-chip-tool-coverage + # Generating linux-x64-chip-tool-ipv6only gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-chip-tool-ipv6only # Generating linux-x64-chip-tool-nodeps -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false' {out}/linux-x64-chip-tool-nodeps +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true' {out}/linux-x64-chip-tool-nodeps + +# Generating linux-x64-chip-tool-nodeps-ipv6only +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true' {out}/linux-x64-chip-tool-nodeps-ipv6only # Generating linux-x64-light gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/linux {out}/linux-x64-light @@ -242,6 +274,15 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} --a # Generating linux-x64-tests-clang gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=is_clang=true chip_build_tests=true' {out}/linux-x64-tests-clang +# Generating linux-x64-tests-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=use_coverage=true chip_build_tests=true' {out}/linux-x64-tests-coverage + +# Create coverage output location +mkdir -p {out}/linux-x64-tests-coverage/coverage + +# Initial coverage baseline +lcov --initial --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_base.info + # Generating linux-x64-thermostat gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/thermostat/linux {out}/linux-x64-thermostat @@ -263,6 +304,12 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa # Building linux-arm64-all-clusters ninja -C {out}/linux-arm64-all-clusters +# Building linux-arm64-all-clusters-app-nodeps +ninja -C {out}/linux-arm64-all-clusters-app-nodeps + +# Building linux-arm64-all-clusters-app-nodeps-ipv6only +ninja -C {out}/linux-arm64-all-clusters-app-nodeps-ipv6only + # Building linux-arm64-all-clusters-ipv6only ninja -C {out}/linux-arm64-all-clusters-ipv6only @@ -284,6 +331,12 @@ ninja -C {out}/linux-arm64-chip-tool # Building linux-arm64-chip-tool-ipv6only ninja -C {out}/linux-arm64-chip-tool-ipv6only +# Building linux-arm64-chip-tool-nodeps +ninja -C {out}/linux-arm64-chip-tool-nodeps + +# Building linux-arm64-chip-tool-nodeps-ipv6only +ninja -C {out}/linux-arm64-chip-tool-nodeps-ipv6only + # Building linux-arm64-light ninja -C {out}/linux-arm64-light @@ -359,6 +412,12 @@ ninja -C {out}/linux-x64-all-clusters # Building linux-x64-all-clusters-app-nodeps ninja -C {out}/linux-x64-all-clusters-app-nodeps +# Building linux-x64-all-clusters-app-nodeps-ipv6only +ninja -C {out}/linux-x64-all-clusters-app-nodeps-ipv6only + +# Building linux-x64-all-clusters-coverage +ninja -C {out}/linux-x64-all-clusters-coverage + # Building linux-x64-all-clusters-ipv6only ninja -C {out}/linux-x64-all-clusters-ipv6only @@ -380,12 +439,18 @@ ninja -C {out}/linux-x64-chip-cert src/tools/chip-cert # Building linux-x64-chip-tool ninja -C {out}/linux-x64-chip-tool +# Building linux-x64-chip-tool-coverage +ninja -C {out}/linux-x64-chip-tool-coverage + # Building linux-x64-chip-tool-ipv6only ninja -C {out}/linux-x64-chip-tool-ipv6only # Building linux-x64-chip-tool-nodeps ninja -C {out}/linux-x64-chip-tool-nodeps +# Building linux-x64-chip-tool-nodeps-ipv6only +ninja -C {out}/linux-x64-chip-tool-nodeps-ipv6only + # Building linux-x64-light ninja -C {out}/linux-x64-light @@ -443,6 +508,24 @@ ninja -C {out}/linux-x64-tests check # Building linux-x64-tests-clang ninja -C {out}/linux-x64-tests-clang check +# Build-only +ninja -C {out}/linux-x64-tests-coverage default + +# Initial coverage baseline +lcov --initial --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_base.info + +# Building linux-x64-tests-coverage +ninja -C {out}/linux-x64-tests-coverage check + +# Update coverage +lcov --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_test.info + +# Final coverage info +lcov --add-tracefile {out}/linux-x64-tests-coverage/coverage/lcov_base.info --add-tracefile {out}/linux-x64-tests-coverage/coverage/lcov_test.info --output-file {out}/linux-x64-tests-coverage/coverage/lcov_final.info + +# HTML coverage +genhtml {out}/linux-x64-tests-coverage/coverage/lcov_final.info --output-directory {out}/linux-x64-tests-coverage/coverage/html + # Building linux-x64-thermostat ninja -C {out}/linux-x64-thermostat diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index e8bcb0bf1568d2..ea1d511153e29d 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -109,5 +109,7 @@ qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light telink-tlsr9518adk80d-light-switch +tizen-arm-all-clusters +tizen-arm-all-clusters-minimal tizen-arm-chip-tool tizen-arm-light diff --git a/scripts/examples/nrfconnect_example.sh b/scripts/examples/nrfconnect_example.sh index c7378923f82bbf..9c2ffa69380f75 100755 --- a/scripts/examples/nrfconnect_example.sh +++ b/scripts/examples/nrfconnect_example.sh @@ -23,7 +23,7 @@ BOARD="$2" shift 2 # Disable debug symbols and firmware build time to increase ccache hit ratio in CI -COMMON_CI_FLAGS=(-DCONFIG_CHIP_DEBUG_SYMBOLS=n -DCONFIG_CHIP_FIRMWARE_BUILD_UNIX_TIME=n) +COMMON_CI_FLAGS=(-DCONFIG_CHIP_DEBUG_SYMBOLS=n) if [[ ! -f "$APP/nrfconnect/CMakeLists.txt" || -z "$BOARD" ]]; then echo "Usage: $0 " >&2 diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index 76975d706317af..fbf73f4dbc4c16 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -41,6 +41,11 @@ TOOLS = {} +FACTORY_PARTITION_CSV = 'nvs_partition.csv' +FACTORY_PARTITION_BIN = 'factory_partition.bin' +NVS_KEY_PARTITION_BIN = 'nvs_key_partition.bin' + + FACTORY_DATA = { # CommissionableDataProvider 'discriminator': { @@ -262,28 +267,39 @@ def generate_nvs_bin(args): continue csv_content += f"{k},{v['type']},{v['encoding']},{v['value']}\n" - with open('nvs_partition.csv', 'w') as f: + with open(FACTORY_PARTITION_CSV, 'w') as f: f.write(csv_content) - nvs_args = SimpleNamespace(input='nvs_partition.csv', - output='partition.bin', - size=hex(args.size), - outdir=os.getcwd(), - version=2) - - nvs_partition_gen.generate(nvs_args) - - -def print_flashing_help(): - logging.info('To flash the generated partition.bin, run the following command:') - logging.info('==============================================================') - logging.info('esptool.py -p write_flash partition.bin') - logging.info('==============================================================') - logging.info('default \"nvs\" partition addr is 0x9000') + if args.encrypt: + nvs_args = SimpleNamespace(version=2, + keygen=True, + keyfile=NVS_KEY_PARTITION_BIN, + inputkey=None, + outdir=os.getcwd(), + input=FACTORY_PARTITION_CSV, + output=FACTORY_PARTITION_BIN, + size=hex(args.size)) + nvs_partition_gen.encrypt(nvs_args) + else: + nvs_args = SimpleNamespace(input=FACTORY_PARTITION_CSV, + output=FACTORY_PARTITION_BIN, + size=hex(args.size), + outdir=os.getcwd(), + version=2) + nvs_partition_gen.generate(nvs_args) + + +def print_flashing_help(encrypt): + logging.info('Run below command to flash {}'.format(FACTORY_PARTITION_BIN)) + logging.info('esptool.py -p (PORT) write_flash (FACTORY_PARTITION_ADDR) {}'.format(os.path.join(os.getcwd(), FACTORY_PARTITION_BIN))) + if (encrypt): + logging.info('Run below command to flash {}'.format(NVS_KEY_PARTITION_BIN)) + logging.info('esptool.py -p (PORT) write_flash --encrypt (NVS_KEY_PARTITION_ADDR) {}'.format( + os.path.join(os.getcwd(), 'keys', NVS_KEY_PARTITION_BIN))) def clean_up(): - os.remove('nvs_partition.csv') + os.remove(FACTORY_PARTITION_CSV) os.remove(FACTORY_DATA['dac-pub-key']['value']) os.remove(FACTORY_DATA['dac-key']['value']) @@ -323,6 +339,8 @@ def any_base_int(s): return int(s, 0) parser.add_argument('-s', '--size', type=any_base_int, required=False, default=0x6000, help='The size of the partition.bin, default: 0x6000') + parser.add_argument('-e', '--encrypt', action='store_true', required=False, + help='Encrypt the factory parititon NVS binary') args = parser.parse_args() validate_args(args) @@ -331,7 +349,7 @@ def any_base_int(s): return int(s, 0) populate_factory_data(args, spake2p_params) gen_raw_ec_keypair_from_der(args.dac_key, FACTORY_DATA['dac-pub-key']['value'], FACTORY_DATA['dac-key']['value']) generate_nvs_bin(args) - print_flashing_help() + print_flashing_help(args.encrypt) clean_up() diff --git a/scripts/tools/memory/platform/bl602.cfg b/scripts/tools/memory/platform/bl602.cfg new file mode 100644 index 00000000000000..1370bfcf5f777c --- /dev/null +++ b/scripts/tools/memory/platform/bl602.cfg @@ -0,0 +1,40 @@ +# 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. + +# Memory tools default configuation for Bouffalolab BL602. + +{ + 'section': { + # By default, only these sections will be included + # when operating by sections. + 'default': ['.text', '.data', '.bss'] + }, + # 'symbol': { + # 'free': { + # # These symbols mark the start or end of areas where memory that + # # does not belong to any symbol is considered unused (rather than + # # a gap that may be in use for some non-symbol purpose, e.g. string + # # constants or alignment). + # 'start': [], + # 'end': [], + # } + # }, + # 'region': { + # # Regions are sets of sections that can be used for aggregate reports. + # 'sections': { + # 'FLASH': [], + # 'RAM': [] + # } + # }, +} diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt index 063e8886f310a3..d93d56496fc904 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt @@ -107,6 +107,10 @@ class WildcardFragment : Fragment() { stringBuilder.append("\t\t$attributeName: ${attributeState.value}\n") } clusterState.eventStates.forEach { (eventId, eventState) -> + stringBuilder.append("\t\teventNumber: ${eventState.eventNumber}\n") + stringBuilder.append("\t\tpriorityLevel: ${eventState.priorityLevel}\n") + stringBuilder.append("\t\tsystemTimeStamp: ${eventState.systemTimeStamp}\n") + val eventName = ChipIdLookup.eventIdToName(clusterId, eventId) stringBuilder.append("\t\t$eventName: ${eventState.value}\n") } diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index e983e15a2feee9..200feee67a1347 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -227,6 +227,25 @@ class CommandHandler */ Messaging::ExchangeContext * GetExchangeContext() const { return mpExchangeCtx; } + /** + * @brief Flush acks right away for a slow command + * + * Some commands that do heavy lifting of storage/crypto should + * ack right away to improve reliability and reduce needless retries. This + * method can be manually called in commands that are especially slow to + * immediately schedule an acknowledgement (if needed) since the delayed + * stand-alone ack timer may actually not hit soon enough due to blocking command + * execution. + * + */ + void FlushAcksRightAwayOnSlowCommand() + { + VerifyOrReturn(mpExchangeCtx != nullptr); + auto * msgContext = mpExchangeCtx->GetReliableMessageContext(); + VerifyOrReturn(msgContext != nullptr); + msgContext->FlushAcks(); + } + Access::SubjectDescriptor GetSubjectDescriptor() const { return mpExchangeCtx->GetSessionHandle()->GetSubjectDescriptor(); } private: diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 8c721b2ecefca0..47ebd1cd926293 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -108,7 +108,10 @@ template("chip_data_model") { foreach(cluster, _cluster_sources) { if (cluster == "door-lock-server") { - sources += [ "${_app_root}/clusters/${cluster}/door-lock-server.cpp" ] + sources += [ + "${_app_root}/clusters/${cluster}/door-lock-server-callback.cpp", + "${_app_root}/clusters/${cluster}/door-lock-server.cpp", + ] } else if (cluster == "mode-select-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 33ddd2979a3a2a..464e4fd2e92a0d 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -96,6 +96,35 @@ CHIP_ERROR LogExtensionChangedEvent(const AccessControlCluster::Structs::Extensi return err; } +CHIP_ERROR CheckExtensionEntryDataFormat(const ByteSpan & data) +{ + CHIP_ERROR err; + + TLV::TLVReader reader; + reader.Init(data); + + auto containerType = chip::TLV::kTLVType_List; + err = reader.Next(containerType, chip::TLV::AnonymousTag()); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + err = reader.EnterContainer(containerType); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(chip::TLV::IsProfileTag(reader.GetTag()), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + err = reader.ExitContainer(containerType); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + err = reader.Next(); + VerifyOrReturnError(err == CHIP_END_OF_TLV, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + return CHIP_NO_ERROR; +} + CHIP_ERROR AccessControlAttribute::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) @@ -294,6 +323,9 @@ CHIP_ERROR AccessControlAttribute::WriteExtension(const ConcreteDataAttributePat auto & item = iterator.GetValue(); // TODO(#13590): generated code doesn't automatically handle max length so do it manually ReturnErrorCodeIf(item.data.size() > kExtensionDataMaxLength, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + ReturnErrorOnFailure(CheckExtensionEntryDataFormat(item.data)); + ReturnErrorOnFailure(storage.SyncSetKeyValue(key.AccessControlExtensionEntry(accessingFabricIndex), item.data.data(), static_cast(item.data.size()))); ReturnErrorOnFailure(LogExtensionChangedEvent(item, aDecoder.GetSubjectDescriptor(), @@ -313,6 +345,9 @@ CHIP_ERROR AccessControlAttribute::WriteExtension(const ConcreteDataAttributePat ReturnErrorOnFailure(aDecoder.Decode(item)); // TODO(#13590): generated code doesn't automatically handle max length so do it manually ReturnErrorCodeIf(item.data.size() > kExtensionDataMaxLength, CHIP_IM_GLOBAL_STATUS(ConstraintError)); + + ReturnErrorOnFailure(CheckExtensionEntryDataFormat(item.data)); + ReturnErrorOnFailure(storage.SyncSetKeyValue(key.AccessControlExtensionEntry(accessingFabricIndex), item.data.data(), static_cast(item.data.size()))); ReturnErrorOnFailure( diff --git a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp new file mode 100644 index 00000000000000..db76ab62abe129 --- /dev/null +++ b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp @@ -0,0 +1,193 @@ +/** + * + * Copyright (c) 2020 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. + */ + +/**************************************************************************** + * @file + * @brief Routines for the Door Lock Server plugin. + ******************************************************************************* + ******************************************************************************/ + +#include "door-lock-server.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters::DoorLock; + +// ============================================================================= +// 'Default' callbacks for cluster commands +// ============================================================================= + +bool __attribute__((weak)) +emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) +{ + err = DlOperationError::kUnspecified; + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) +{ + err = DlOperationError::kUnspecified; + return false; +} + +// ============================================================================= +// 'Default' pre-change callbacks for cluster attributes +// ============================================================================= + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, chip::CharSpan newLanguage) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnAutoRelockTimeChange(chip::EndpointId EndpointId, uint32_t newTime) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnSoundVolumeChange(chip::EndpointId EndpointId, uint8_t newVolume) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnOperatingModeChange(chip::EndpointId EndpointId, uint8_t newMode) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnEnableOneTouchLockingChange(chip::EndpointId EndpointId, bool enable) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnEnablePrivacyModeButtonChange(chip::EndpointId EndpointId, bool enable) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnWrongCodeEntryLimitChange(chip::EndpointId EndpointId, uint8_t newLimit) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnUserCodeTemporaryDisableTimeChange(chip::EndpointId EndpointId, uint8_t newTime) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnUnhandledAttributeChange(chip::EndpointId EndpointId, const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attrType, uint16_t attrSize, uint8_t * attrValue) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +// ============================================================================= +// Users and credentials access callbacks +// ============================================================================= + +bool __attribute__((weak)) +emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, + const chip::CharSpan & userName, uint32_t uniqueId, DlUserStatus userStatus, DlUserType usertype, + DlCredentialRule credentialRule, const DlCredential * credentials, size_t totalCredentials) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, DlCredentialType credentialType, + EmberAfPluginDoorLockCredentialInfo & credential) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, + chip::FabricIndex modifier, DlCredentialStatus credentialStatus, DlCredentialType credentialType, + const chip::ByteSpan & credentialData) +{ + return false; +} + +DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, + uint16_t userIndex, EmberAfPluginDoorLockWeekDaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, + uint16_t userIndex, EmberAfPluginDoorLockYearDaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, EmberAfPluginDoorLockHolidaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, DlScheduleStatus status, + DlDaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, DlScheduleStatus status, + uint32_t localStartTime, uint32_t localEndTime) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, + uint32_t localStartTime, uint32_t localEndTime, DlOperatingMode operatingMode) +{ + return DlStatus::kFailure; +} 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 2c92d1c73ae616..cfff140c65dac8 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -3602,155 +3602,6 @@ void MatterDoorLockPluginServerInitCallback() void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} -// ============================================================================= -// 'Default' callbacks for cluster commands -// ============================================================================= - -bool __attribute__((weak)) -emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) -{ - err = DlOperationError::kUnspecified; - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) -{ - err = DlOperationError::kUnspecified; - return false; -} - -// ============================================================================= -// 'Default' pre-change callbacks for cluster attributes -// ============================================================================= - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, chip::CharSpan newLanguage) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnAutoRelockTimeChange(chip::EndpointId EndpointId, uint32_t newTime) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnSoundVolumeChange(chip::EndpointId EndpointId, uint8_t newVolume) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnOperatingModeChange(chip::EndpointId EndpointId, uint8_t newMode) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnEnableOneTouchLockingChange(chip::EndpointId EndpointId, bool enable) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnEnablePrivacyModeButtonChange(chip::EndpointId EndpointId, bool enable) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnWrongCodeEntryLimitChange(chip::EndpointId EndpointId, uint8_t newLimit) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnUserCodeTemporaryDisableTimeChange(chip::EndpointId EndpointId, uint8_t newTime) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnUnhandledAttributeChange(chip::EndpointId EndpointId, const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attrType, uint16_t attrSize, uint8_t * attrValue) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -// ============================================================================= -// Users and credentials access callbacks -// ============================================================================= - -bool __attribute__((weak)) -emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, - const chip::CharSpan & userName, uint32_t uniqueId, DlUserStatus userStatus, DlUserType usertype, - DlCredentialRule credentialRule, const DlCredential * credentials, size_t totalCredentials) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, DlCredentialType credentialType, - EmberAfPluginDoorLockCredentialInfo & credential) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, - chip::FabricIndex modifier, DlCredentialStatus credentialStatus, DlCredentialType credentialType, - const chip::ByteSpan & credentialData) -{ - return false; -} - -DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, - uint16_t userIndex, EmberAfPluginDoorLockWeekDaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, - uint16_t userIndex, EmberAfPluginDoorLockYearDaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, EmberAfPluginDoorLockHolidaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, DlScheduleStatus status, - DlDaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime, DlOperatingMode operatingMode) -{ - return DlStatus::kFailure; -} - // ============================================================================= // Timer callbacks // ============================================================================= diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 71d565f8e02bb1..e1eb32eb04c994 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -120,12 +120,21 @@ static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, void emberAfGroupsClusterServerInitCallback(EndpointId endpointId) { // The most significant bit of the NameSupport attribute indicates whether or not group names are supported - static constexpr uint8_t nameSupport = 0x80; - EmberAfStatus status = Attributes::NameSupport::Set(endpointId, nameSupport); + // + // According to spec, highest bit (Group Names supported) MUST match feature bit 0 (Group Names supported) + static constexpr uint8_t kNameSuppportFlagGroupNamesSupported = 0x80; + + EmberAfStatus status = Attributes::NameSupport::Set(endpointId, kNameSuppportFlagGroupNamesSupported); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogDetail(Zcl, "ERR: writing name support %x", status); } + + status = Attributes::FeatureMap::Set(endpointId, static_cast(GroupClusterFeature::kGroupNames)); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogDetail(Zcl, "ERR: writing group feature map %x", status); + } } bool emberAfGroupsClusterAddGroupCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 3127a3f75b0c08..2f051aa70fc644 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -264,7 +264,7 @@ CHIP_ERROR DeleteFabricFromTable(FabricIndex fabricIndex) void CleanupSessionsForFabric(SessionManager & sessionMgr, FabricIndex fabricIndex) { InteractionModelEngine::GetInstance()->CloseTransactionsFromFabricIndex(fabricIndex); - sessionMgr.ExpireAllPairingsForFabric(fabricIndex); + sessionMgr.ExpireAllSessionsForFabric(fabricIndex); } void FailSafeCleanup(const chip::DeviceLayer::ChipDeviceEvent * event) @@ -278,13 +278,16 @@ void FailSafeCleanup(const chip::DeviceLayer::ChipDeviceEvent * event) // Session Context at the Server. if (event->FailSafeTimerExpired.addNocCommandHasBeenInvoked || event->FailSafeTimerExpired.updateNocCommandHasBeenInvoked) { - CASESessionManager * caseSessionManager = Server::GetInstance().GetCASESessionManager(); - if (caseSessionManager) + // TODO(#19259): The following scope will no longer need to exist after #19259 is fixed { - const FabricInfo * fabricInfo = Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabricIndex); - VerifyOrReturn(fabricInfo != nullptr); + CASESessionManager * caseSessionManager = Server::GetInstance().GetCASESessionManager(); + if (caseSessionManager) + { + const FabricInfo * fabricInfo = Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabricIndex); + VerifyOrReturn(fabricInfo != nullptr); - caseSessionManager->ReleaseSessionsForFabric(fabricInfo->GetFabricIndex()); + caseSessionManager->ReleaseSessionsForFabric(fabricInfo->GetFabricIndex()); + } } SessionManager & sessionMgr = Server::GetInstance().GetSecureSessionManager(); @@ -416,6 +419,8 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(app::CommandHandle return true; } + commandObj->FlushAcksRightAwayOnSlowCommand(); + CHIP_ERROR err = DeleteFabricFromTable(fabricBeingRemoved); SuccessOrExit(err); @@ -638,6 +643,9 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co // Internal error that would prevent IPK from being added VerifyOrExit(groupDataProvider != nullptr, nonDefaultStatus = Status::Failure); + // Flush acks before really slow work + commandObj->FlushAcksRightAwayOnSlowCommand(); + // TODO: Add support for calling AddNOC without a prior AddTrustedRootCertificate if // the root properly matches an existing one. @@ -803,6 +811,9 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler * VerifyOrExit(fabricInfo != nullptr, nocResponse = ConvertToNOCResponseStatus(CHIP_ERROR_INSUFFICIENT_PRIVILEGE)); fabricIndex = fabricInfo->GetFabricIndex(); + // Flush acks before really slow work + commandObj->FlushAcksRightAwayOnSlowCommand(); + err = fabricTable.UpdatePendingFabricWithOperationalKeystore(fabricIndex, NOCValue, ICACValue.ValueOr(ByteSpan{})); VerifyOrExit(err == CHIP_NO_ERROR, nocResponse = ConvertToNOCResponseStatus(err)); @@ -830,6 +841,17 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler * else { ChipLogProgress(Zcl, "OpCreds: UpdateNOC successful."); + + // On success, revoke all CASE sessions on the fabric hosting the exchange. + // From spec: + // + // All internal data reflecting the prior operational identifier of the Node within the Fabric + // SHALL be revoked and removed, to an outcome equivalent to the disappearance of the prior Node, + // except for the ongoing CASE session context, which SHALL temporarily remain valid until the + // `NOCResponse` has been successfully delivered or until the next transport-layer error, so + // that the response can be received by the Administrator invoking the command. + + commandObj->GetExchangeContext()->AbortAllOtherCommunicationOnFabric(); } } // No NOC response - Failed constraints @@ -921,6 +943,10 @@ bool emberAfOperationalCredentialsClusterAttestationRequestCallback(app::Command const ByteSpan kEmptyFirmwareInfo; ChipLogProgress(Zcl, "OpCreds: Received an AttestationRequest command"); + + // Flush acks before really slow work + commandObj->FlushAcksRightAwayOnSlowCommand(); + Credentials::DeviceAttestationCredentialsProvider * dacProvider = Credentials::GetDeviceAttestationCredentialsProvider(); VerifyOrExit(attestationNonce.size() == Credentials::kExpectedAttestationNonceSize, finalStatus = Status::InvalidCommand); @@ -1020,6 +1046,9 @@ bool emberAfOperationalCredentialsClusterCSRRequestCallback(app::CommandHandler VerifyOrExit(failSafeContext.IsFailSafeArmed(commandObj->GetAccessingFabricIndex()), finalStatus = Status::FailsafeRequired); VerifyOrExit(!failSafeContext.NocCommandHasBeenInvoked(), finalStatus = Status::ConstraintError); + // Flush acks before really slow work + commandObj->FlushAcksRightAwayOnSlowCommand(); + // Prepare NOCSRElements structure { constexpr size_t csrLength = Crypto::kMAX_CSR_Length; @@ -1143,10 +1172,12 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( // be useful in the context. VerifyOrExit(!failSafeContext.NocCommandHasBeenInvoked(), finalStatus = Status::ConstraintError); - // TODO: Handle checking for byte-to-byte match with existing fabrics - // before allowing the add + // Flush acks before really slow work + commandObj->FlushAcksRightAwayOnSlowCommand(); + + // TODO(#17208): Handle checking for byte-to-byte match with existing fabrics before allowing the add - // TODO: Validate cert signature prior to setting. + // TODO(#17208): Validate cert signature prior to setting. err = fabricTable.AddNewPendingTrustedRootCert(rootCertificate); VerifyOrExit(err != CHIP_ERROR_NO_MEMORY, finalStatus = Status::ResourceExhausted); diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp index 3f4cf67829c56d..bc7f857834b7cf 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp @@ -638,14 +638,12 @@ void DefaultOTARequestor::OnDownloadStateChanged(OTADownloader::State state, OTA { case OTADownloader::State::kComplete: mOtaRequestorDriver->UpdateDownloaded(); - mBdxMessenger.Reset(); break; case OTADownloader::State::kIdle: if (reason != OTAChangeReasonEnum::kSuccess) { RecordErrorUpdateState(CHIP_ERROR_CONNECTION_ABORTED, reason); } - mBdxMessenger.Reset(); break; default: break; @@ -825,10 +823,10 @@ CHIP_ERROR DefaultOTARequestor::StartDownload(OperationalDeviceProxy & devicePro Optional session = deviceProxy.GetSecureSession(); VerifyOrReturnError(session.HasValue(), CHIP_ERROR_INCORRECT_STATE); - chip::Messaging::ExchangeContext * exchangeCtx = exchangeMgr->NewContext(session.Value(), &mBdxMessenger); - VerifyOrReturnError(exchangeCtx != nullptr, CHIP_ERROR_NO_MEMORY); + mExchangeCtx = exchangeMgr->NewContext(session.Value(), &mBdxMessenger); + VerifyOrReturnError(mExchangeCtx != nullptr, CHIP_ERROR_NO_MEMORY); - mBdxMessenger.Init(mBdxDownloader, exchangeCtx); + mBdxMessenger.Init(mBdxDownloader, mExchangeCtx); mBdxDownloader->SetMessageDelegate(&mBdxMessenger); mBdxDownloader->SetStateDelegate(this); diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.h b/src/app/clusters/ota-requestor/DefaultOTARequestor.h index 99e9ae14c1b123..13c2f1bea9a504 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.h +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.h @@ -175,13 +175,6 @@ class DefaultOTARequestor : public OTARequestorInterface, public BDXDownloader:: mDownloader = downloader; } - void Reset() - { - VerifyOrReturn(mExchangeCtx != nullptr); - mExchangeCtx->Close(); - mExchangeCtx = nullptr; - } - private: chip::Messaging::ExchangeContext * mExchangeCtx; chip::BDXDownloader * mDownloader; @@ -299,12 +292,13 @@ class DefaultOTARequestor : public OTARequestorInterface, public BDXDownloader:: */ static void OnCommissioningCompleteRequestor(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg); - OTARequestorStorage * mStorage = nullptr; - OTARequestorDriver * mOtaRequestorDriver = nullptr; - CASESessionManager * mCASESessionManager = nullptr; - OnConnectedAction mOnConnectedAction = kQueryImage; - BDXDownloader * mBdxDownloader = nullptr; // TODO: this should be OTADownloader - BDXMessenger mBdxMessenger; // TODO: ideally this is held by the application + OTARequestorStorage * mStorage = nullptr; + OTARequestorDriver * mOtaRequestorDriver = nullptr; + CASESessionManager * mCASESessionManager = nullptr; + OnConnectedAction mOnConnectedAction = kQueryImage; + Messaging::ExchangeContext * mExchangeCtx = nullptr; + BDXDownloader * mBdxDownloader = nullptr; // TODO: this should be OTADownloader + BDXMessenger mBdxMessenger; // TODO: ideally this is held by the application uint8_t mUpdateTokenBuffer[kMaxUpdateTokenLen]; ByteSpan mUpdateToken; uint32_t mCurrentVersion = 0; diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp index 95b19fd5be564a..d813e568f64fc3 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -51,7 +51,7 @@ CHIP_ERROR PowerSourceAttrAccess::Read(const ConcreteReadAttributePath & aPath, switch (aPath.mAttributeId) { - case ActiveBatteryFaults::Id: + case ActiveBatFaults::Id: // TODO: Needs implementation. err = aEncoder.EncodeEmptyList(); break; diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index bb5b2a54228344..8c09b782a06677 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -53,6 +53,29 @@ class UserLabelAttrAccess : public AttributeAccessInterface CHIP_ERROR WriteLabelList(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder); }; +/// Matches constraints on a LabelStruct. +bool IsValidLabelEntry(const Structs::LabelStruct::Type & entry) +{ + constexpr size_t kMaxLabelSize = 16; + constexpr size_t kMaxValueSize = 16; + + // NOTE: spec default for label and value is empty, so empty is accepted here + return (entry.label.size() <= kMaxLabelSize) && (entry.value.size() <= kMaxValueSize); +} + +bool IsValidLabelEntryList(const LabelList::TypeInfo::DecodableType & list) +{ + auto iter = list.begin(); + while (iter.Next()) + { + if (!IsValidLabelEntry(iter.GetValue())) + { + return false; + } + } + return true; +} + UserLabelAttrAccess gAttrAccess; CHIP_ERROR UserLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder) @@ -106,6 +129,7 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(const ConcreteDataAttributePath & LabelList::TypeInfo::DecodableType decodablelist; ReturnErrorOnFailure(aDecoder.Decode(decodablelist)); + ReturnErrorCodeIf(!IsValidLabelEntryList(decodablelist), CHIP_IM_GLOBAL_STATUS(ConstraintError)); auto iter = decodablelist.begin(); while (iter.Next()) @@ -120,7 +144,10 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(const ConcreteDataAttributePath & if (aPath.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) { Structs::LabelStruct::DecodableType entry; + ReturnErrorOnFailure(aDecoder.Decode(entry)); + ReturnErrorCodeIf(!IsValidLabelEntry(entry), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + return provider->AppendUserLabel(endpoint, entry); } diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 4aa945c860805e..039bf7da5105d3 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -55,7 +55,7 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv DeviceLayer::SystemLayer().CancelTimer(HandleCommissioningWindowTimeout, this); mCommissioningTimeoutTimerArmed = false; Cleanup(); - mServer->GetSecureSessionManager().ExpireAllPASEPairings(); + mServer->GetSecureSessionManager().ExpireAllPASESessions(); // That should have cleared out mPASESession. #if CONFIG_NETWORK_LAYER_BLE mServer->GetBleLayerObject()->CloseAllBleConnections(); diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 44c30043dc4a5c..e6247c5153f9d4 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -252,7 +252,14 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) SuccessOrExit(err); #endif - app::DnssdServer::Instance().SetSecuredPort(mOperationalServicePort); + // + // We need to advertise the port that we're listening to for unsolicited messages over UDP. However, we have both a IPv4 + // and IPv6 endpoint to pick from. Given that the listen port passed in may be set to 0 (which then has the kernel select + // a valid port at bind time), that will result in two possible ports being provided back from the resultant endpoint + // initializations. Since IPv6 is POR for Matter, let's go ahead and pick that port. + // + app::DnssdServer::Instance().SetSecuredPort(mTransports.GetTransport().GetImplAtIndex<0>().GetBoundPort()); + app::DnssdServer::Instance().SetUnsecuredPort(mUserDirectedCommissioningPort); app::DnssdServer::Instance().SetInterfaceId(mInterfaceId); diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 7045dcad598381..9ef21431d9772b 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -66,6 +66,10 @@ namespace chip { constexpr size_t kMaxBlePendingPackets = 1; +// +// NOTE: Please do not alter the order of template specialization here as the logic +// in the Server impl depends on this. +// using ServerTransportMgr = chip::TransportMgr + bool CheckConstraintHasMasksSet(const char * itemName, const T & current, const U & expected) + { + if (current & expected) + { + return true; + } + + Exit(std::string(itemName) + " expects the field with value " + std::to_string(expected) + " to be set but it is not."); + return false; + } + + template + bool CheckConstraintHasMasksSet(const char * itemName, const chip::BitMask & current, const U & expected) + { + if (current.Has(static_cast(expected))) + { + return true; + } + + Exit(std::string(itemName) + " expects the field with value " + std::to_string(expected) + " to be set but it is not."); + return false; + } + + template + bool CheckConstraintHasMasksClear(const char * itemName, const T & current, const U & expected) + { + if ((current & expected) == 0) + { + return true; + } + + Exit(std::string(itemName) + " expects the field with value " + std::to_string(expected) + " to not be set but it is."); + return false; + } + + template + bool CheckConstraintHasMasksClear(const char * itemName, const chip::BitMask & current, const U & expected) + { + if (!current.Has(static_cast(expected))) + { + return true; + } + + Exit(std::string(itemName) + " expects the field with value " + std::to_string(expected) + " to not be set but it is."); + return false; + } }; diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index 97fa30a28d5f71..dee8f0728dbe0a 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -717,6 +717,7 @@ function getTests() { "TestSystemCommands", "TestBinding", "TestUserLabelCluster", + "TestUserLabelClusterConstraints", "TestArmFailSafe", "TestFanControl", ]; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 3d04681d82210f..2b65111c415c43 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -62,7 +62,6 @@ - diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml index c3540b2bbb8d6c..28ba55b9f30983 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml @@ -24,44 +24,40 @@ limitations under the License. true true This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. - - Status + Status Order Description - WiredAssessedInputVoltage - WiredAssessedInputFrequency - WiredCurrentType - WiredAssessedCurrent + + WiredAssessedInputVoltage + WiredAssessedInputFrequency + WiredCurrentType + WiredAssessedCurrent WiredNominalVoltage WiredMaximumCurrent WiredPresent - ActiveWiredFaults - BatteryVoltage - BatteryPercentRemaining - BatteryTimeRemaining - BatteryChargeLevel - BatteryReplacementNeeded - BatteryReplaceability - BatteryPresent - ActiveBatteryFaults - BatteryReplacementDescription - BatteryCommonDesignation - BatteryANSIDesignation - BatteryIECDesignation - BatteryApprovedChemistry - BatteryCapacity - BatteryQuantity - BatteryChargeState - BatteryTimeToFullCharge - BatteryFunctionalWhileCharging - BatteryChargingCurrent - ActiveBatteryChargeFaults + ActiveWiredFaults + + BatVoltage + BatPercentRemaining + BatTimeRemaining + BatChargeLevel + BatReplacementNeeded + BatReplaceability + BatPresent + ActiveBatFaults + BatReplacementDescription + BatCommonDesignation + BatANSIDesignation + BatIECDesignation + BatApprovedChemistry + BatCapacity + BatQuantity + BatChargeState + BatTimeToFullCharge + BatFunctionalWhileCharging + BatChargingCurrent + ActiveBatChargeFaults