diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ff773c6f51e05d..4c8a11fd42f7f1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -55,14 +55,13 @@ RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/resty RUN mkdir -p /opt/sdk/sdks/ \ && chown -R $USERNAME:$USERNAME \ /opt/sdk/sdks/ `# NXP uses a patch_sdk script to change SDK files` \ - /opt/espressif/esp-idf `# $USERNAME needs to own the esp-idf and tools for the examples to build` \ - /opt/espressif/tools \ /opt/NordicSemiconductor/nrfconnect/ `# $USERNAME needs to own west configuration to build nRF Connect examples` \ - /opt/ubuntu-21.04-aarch64-sysroot/usr/ `# allow read/write access to header and libraries` \ - /opt/android/sdk `# allow licenses to be accepted` \ - /opt/ameba/ambd_sdk_with_chip_non_NDA/ `# AmebaD requires access to change build_info.h` \ - /opt/fsl-imx-xwayland/5.15-kirkstone/ \ - /opt/openocd \ + $IDF_PATH `# $USERNAME needs to own the esp-idf and tools for the examples to build` \ + $IDF_TOOLS_PATH \ + $SYSROOT_AARCH64 `# allow read/write access to header and libraries` \ + $ANDROID_HOME `# allow licenses to be accepted` \ + $AMEBA_PATH `# AmebaD requires access to change build_info.h` \ + $IMX_SDK_ROOT \ && : # Fix Tizen SDK paths for new user diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f33e83f87b17fa..94ad9314b9a56c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,7 @@ "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], - "initializeCommand": ".devcontainer/build.sh --tag matter-dev-environment:local --version 20", + "initializeCommand": ".devcontainer/build.sh --tag matter-dev-environment:local --version 22", "image": "matter-dev-environment:local", "remoteUser": "vscode", "customizations": { diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml index d60a69ce6d62fd..892cf93716cb8d 100644 --- a/.github/actions/checkout-submodules-and-bootstrap/action.yaml +++ b/.github/actions/checkout-submodules-and-bootstrap/action.yaml @@ -26,17 +26,10 @@ runs: uses: ./.github/actions/bootstrap-cache - name: Bootstrap uses: ./.github/actions/bootstrap + env: + PW_NO_CIPD_CACHE_DIR: Y with: platform: ${{ inputs.platform }} - - name: Remove CIPD cache directory - # If there is a bootstrap-cache miss, and bootstrap installs CIPD itself, - # there is roughly 1.4GB that remains in this cache that is useless from - # this point onwards. - shell: bash - continue-on-error: true - run: | - du -sh $HOME/.cipd-cache-dir/ - rm -rf $HOME/.cipd-cache-dir/ || echo "Removing cipd cache dir failed" - name: Dump disk info after checkout submodule & Bootstrap shell: bash run: scripts/dump_diskspace_info.sh diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index e6f02432b16793..2a1dee179aa3e0 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bf6bc47597b6c3..588ded31e8cbf9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -85,18 +85,22 @@ jobs: # - name: Upload Code Coverage # if: ${{ contains('main', env.BUILD_TYPE) }} # run: bash <(curl -s https://codecov.io/bash) - - name: Setup Build Without Detail Logging + - name: Set up Build Without Detail Logging run: scripts/build/gn_gen.sh --args="chip_detail_logging=false" - name: Run Build Without Detail Logging run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Setup Build Without Progress Logging + - name: Set up Build Without Progress Logging run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false" - name: Run Build Without Progress Logging run: scripts/run_in_build_env.sh "ninja -C ./out" - - name: Setup Build Without Error Logging + - name: Set up Build Without Error Logging run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false" - name: Run Build Without Error Logging run: scripts/run_in_build_env.sh "ninja -C ./out" + - name: Set up Build Without Logging + run: scripts/build/gn_gen.sh --args="chip_logging=false" + - name: Run Build Without Logging + run: scripts/run_in_build_env.sh "ninja -C ./out" - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} @@ -131,7 +135,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -279,7 +283,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -332,6 +336,39 @@ jobs: pip3 install -r src/setup_payload/python/requirements.txt python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool + build_linux_python_lighting_device: + name: Build on Linux (python lighting-app) + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:22 + volumes: + - "/tmp/log_output:/tmp/test_logs" + options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 + net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" + + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump Concurrency context + env: + CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + run: echo "$CONCURRENCY_CONTEXT" + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + + - name: Setup Build + run: | + scripts/build_python_device.sh --chip_detail_logging true + build_darwin: name: Build on Darwin (clang, python_lib, simulated) runs-on: macos-latest @@ -414,7 +451,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 6767d78ea46cf3..2b5b34478b677f 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 options: --user root steps: @@ -54,7 +54,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:21 + image: ghcr.io/project-chip/chip-build-esp32:22 options: --user root steps: @@ -75,7 +75,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:21 + image: ghcr.io/project-chip/chip-build-nrf-platform:22 options: --user root steps: @@ -96,7 +96,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:21 + image: ghcr.io/project-chip/chip-build-telink:22 options: --user root steps: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index 25f6484d4bf2ad..c19e1dd911755c 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -40,7 +40,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: ghcr.io/project-chip/chip-build-cirque:21 + # image: ghcr.io/project-chip/chip-build-cirque:22 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index 887bd532cedf33..21f2a227be1a72 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -28,7 +28,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: test_suites_chip_tool_darwin: name: Test Suites - Darwin @@ -38,6 +38,14 @@ jobs: build_variant: [no-ble-asan-clang] env: BUILD_VARIANT: ${{matrix.build_variant}} + + # We can't use the pigweed clang to build the Darwin framework once we start using + # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. + # + # But the Xcode clang does not handle LSan correctly. Since we can't easily apply + # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for + # it. + BUILD_VARIANT_FRAMEWORK_TOOL: no-ble LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt if: github.actor != 'restyled-io[bot]' @@ -83,7 +91,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \ + --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ --target darwin-x64-all-clusters-${BUILD_VARIANT} \ --target darwin-x64-lock-${BUILD_VARIANT} \ --target darwin-x64-ota-provider-${BUILD_VARIANT} \ @@ -97,7 +105,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ - --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \ + --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ --target-skip-glob '{TestAccessControlConstraints}' \ run \ --iterations 1 \ @@ -114,7 +122,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/tests/run_darwin_framework_ota_test.py \ run \ - --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \ + --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ --ota-data-file /tmp/rawImage \ --ota-image-file /tmp/otaImage \ @@ -139,8 +147,8 @@ jobs: uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} with: - name: framework-build-log-darwin-${{ matrix.build_variant }} - path: out/darwin-x64-darwin-framework-tool-${{ matrix.build_variant }}/darwin_framework_build.log + name: framework-build-log-darwin-${{BUILD_VARIANT_FRAMEWORK_TOOL}} + path: out/darwin-x64-darwin-framework-tool-${{BUILD_VARIANT_FRAMEWORK_TOOL}}/darwin_framework_build.log - name: Uploading objdir for debugging uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 09ff0b2fce1925..8b7e44ef82ee00 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -112,7 +112,9 @@ jobs: # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) # And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned on. - TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2) + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2) + # And the same thing, but with MTR_ENABLE_PROVISIONAL also turned on. + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1 MTR_ENABLE_PROVISIONAL=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2) # And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors. TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2) # -enableThreadSanitizer instruments the code in Matter.framework, diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index efc82b13c13f9f..4e4e2abf319891 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:21 + image: ghcr.io/project-chip/chip-build-doxygen:22 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 2e8e9465d90dca..42afb3ee37b1e7 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:21 + image: ghcr.io/project-chip/chip-build-ameba:22 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 2257c9ed54a62a..7bb7e790595f10 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:21 + image: ghcr.io/project-chip/chip-build-asr:22 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 6564a304ee0fe8..53a43c267251c6 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:21 + image: ghcr.io/project-chip/chip-build-bouffalolab:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index e7548e6f5413d5..4229f9800f2df8 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:21 + image: ghcr.io/project-chip/chip-build-ti:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index 1d0d65c30110fb..5a77c801447b6e 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:21 + image: ghcr.io/project-chip/chip-build-ti:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -57,7 +57,7 @@ jobs: run: | scripts/run_in_build_env.sh "\ ./scripts/build/build_examples.py \ - --target cc32xx-lock build \ + --target cc32xx-lock --target cc32xx-air-purifier build \ --copy-artifacts-to out/artifacts \ " - name: Get lock app size stats @@ -67,6 +67,13 @@ jobs: out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \ /tmp/bloat_reports/ + - name: Get air purifier app size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc32xx CC3235SF_LAUNCHXL air-purifier \ + out/artifacts/cc32xx-air-purifier/chip-CC3235SF_LAUNCHXL-air-purifier-example.out \ + /tmp/bloat_reports/ + - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index ee7159475b14d1..899ac288dc1c70 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:21 + image: ghcr.io/project-chip/chip-build-efr32:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 8fbf75f9ebea37..f1b8ff3b6f20a7 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:21 + image: ghcr.io/project-chip/chip-build-esp32:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -130,7 +130,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:21 + image: ghcr.io/project-chip/chip-build-esp32:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index b7f5e201291522..7fc006fe8f6698 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:21 + image: ghcr.io/project-chip/chip-build-infineon:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index df88c5a9dabaac..541106d618e2d5 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-k32w:21 + image: ghcr.io/project-chip/chip-build-k32w:22 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 371ecac04d11a7..4645b4e897d3ff 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:21 + image: ghcr.io/project-chip/chip-build-crosscompile:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -59,6 +59,7 @@ jobs: --target linux-arm64-chip-cert-clang \ --target linux-arm64-all-clusters-clang \ --target linux-arm64-chip-tool-ipv6only-clang \ + --target linux-arm64-chip-tool-nodeps-ipv6only \ --target linux-arm64-lock-clang \ --target linux-arm64-minmdns-clang \ --target linux-arm64-light-rpc-ipv6only-clang \ diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 4508d39da3f438..e34148a8ff0a91 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:21 + image: ghcr.io/project-chip/chip-build-imx:22 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index d6740787696105..8661b99d253b5f 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: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -186,6 +186,16 @@ jobs: "./scripts/build/build_examples.py \ --target linux-x64-contact-sensor-no-ble-with-ui \ build" + - name: Build example Air Purifier + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-air-purifier \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug air-purifier-app \ + out/linux-x64-air-purifier/chip-air-purifier-app \ + /tmp/bloat_reports/ - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index cfd022219b3cf4..a73d825ee444e8 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-mbed-os:21 + image: ghcr.io/project-chip/chip-build-mbed-os:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index a879dc16e34e50..b5658efdcdf687 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 5d05fb34f286ad..b1cf4cd87279f3 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:21 + image: ghcr.io/project-chip/chip-build-nrf-platform:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index 4fd20ce854f31b..de63249ee89d6a 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:21 + image: ghcr.io/project-chip/chip-build-openiotsdk:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 2fcb50ae6a339f..3590b33a7c6829 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 5c8189cbe01711..dce5de01d786d9 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -68,4 +68,3 @@ jobs: if: ${{ !env.ACT }} with: platform-name: stm32 - diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f3e5cfb59e2d88..225ddf16fd190b 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:21 + image: ghcr.io/project-chip/chip-build-telink:22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 1e375b1ff0ea91..f6ca3bb793dc87 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:21 + image: ghcr.io/project-chip/chip-build-tizen:22 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -55,7 +55,7 @@ jobs: --enable-flashbundle \ --target tizen-arm-all-clusters \ --target tizen-arm-chip-tool-ubsan \ - --target tizen-arm-light \ + --target tizen-arm-light-with-ui \ build \ --copy-artifacts-to out/artifacts \ " diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 319cce82a3c217..a227bdd6e16d08 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:21 + image: ghcr.io/project-chip/chip-build-android:22 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 42d8134470ba2b..21ae6619fe0e73 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index f4711ca5bfb9ff..fe27fe9cdd4eb1 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:21 + image: ghcr.io/project-chip/chip-build-java:22 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 941598cc6d7b65..b70ac09cb8ad5b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 steps: - name: Checkout diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index a6c95979f200fe..269692c1461410 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:21 + image: ghcr.io/project-chip/chip-build-minimal:22 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index b16d073224d0af..ac677a83d61468 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:21 + image: ghcr.io/project-chip/chip-build-esp32-qemu:22 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -76,7 +76,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen-qemu:21 + image: ghcr.io/project-chip/chip-build-tizen-qemu:22 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index f0c816125f6190..9baca19da32835 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:21 + image: ghcr.io/project-chip/chip-build-esp32:22 steps: - name: Checkout @@ -68,7 +68,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:21 + image: ghcr.io/project-chip/chip-build-efr32:22 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 6b493cbb990627..ee0fe3400830ab 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:21 + image: ghcr.io/project-chip/chip-build-android:22 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tag-releases.yaml b/.github/workflows/tag-releases.yaml new file mode 100644 index 00000000000000..cdeb8778ab10f3 --- /dev/null +++ b/.github/workflows/tag-releases.yaml @@ -0,0 +1,52 @@ +# Copyright (c) 2020-2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: "Tag Releases" + +on: + workflow_dispatch: + # inputs: + # draft_release: + # description: 'Create Draft' + # required: true + # default: true + # type: boolean + # branch: + # description: 'Branch' + # required: false + # type: string +jobs: + tag_main_release: + name: Tag Current Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install gh tool + run: | + type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install gh -y + + - name: Tag Release & Generate Notes + env: + GH_TOKEN: ${{ github.token }} + run: | + export BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) + echo "Tagging against branch: $BRANCH_NAME" + ./scripts/tagging/tag_new_release.sh --generate-notes --target "$BRANCH_NAME" -d # Note this is a draft for now. + + diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bb0a781f8b566c..d6c580e643e9ff 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -85,7 +85,7 @@ jobs: # run: | ./scripts/run_in_build_env.sh \ - "./scripts/py_matter_idl/matter_idl/xml_parser.py \ + "./scripts/py_matter_idl/matter_idl/zapxml_parser.py \ --no-print \ --log-level info \ src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ @@ -402,7 +402,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" @@ -468,6 +468,7 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCCLEANM_1_2.py" --script-args "--int-arg PIXIT_ENDPOINT:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCRUNM_1_2.py" --script-args "--int-arg PIXIT_ENDPOINT:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestConformanceSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_12.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 9ae5f2df18b295..9a365cb09c2438 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: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 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 5e50d26365b2d0..8ccd058de07b87 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index e84a8f6bc3e076..a83069e9468d28 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:21 + image: ghcr.io/project-chip/chip-build:22 defaults: run: shell: sh diff --git a/.gitmodules b/.gitmodules index 28bdba881cb8b2..6683ee97ecb02e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,7 +62,7 @@ platforms = k32w [submodule "third_party/openthread/ot-nxp"] path = third_party/openthread/ot-nxp - url = https://github.com/openthread/ot-nxp.git + url = https://github.com/NXP/ot-nxp.git platforms = k32w [submodule "third_party/openthread/ot-qorvo"] path = third_party/openthread/ot-qorvo diff --git a/.restyled.yaml b/.restyled.yaml index 06180a098228e9..aeedbacd16240c 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -76,6 +76,7 @@ exclude: - "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*" - "integrations/cloudbuild/*.yaml" # uglier long command line content - "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs + - "scripts/tagging/tag_new_release.sh" # shellharden breaks parameter passing - "src/darwin/Framework/CHIP/zap-generated/*" # already clang-formatted by our zap tooling - "zzz_generated/**/*" # already clang-formatted by our zap tooling - "src/controller/java/generated/java/**/*" # not formatted: generated files diff --git a/.vscode/settings.json b/.vscode/settings.json index 7524bf25d83ec2..bfac435030bb4f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -115,7 +115,9 @@ "condition_variable": "cpp", "numeric": "cpp", "random": "cpp", - "thread": "cpp" + "thread": "cpp", + "variant": "cpp", + "any": "cpp" }, // Configure paths or glob patterns to exclude from file watching. "files.watcherExclude": { diff --git a/SPECIFICATION_VERSION b/SPECIFICATION_VERSION new file mode 100644 index 00000000000000..26aaba0e86632e --- /dev/null +++ b/SPECIFICATION_VERSION @@ -0,0 +1 @@ +1.2.0 diff --git a/build_overrides/nxp_sdk.gni b/build_overrides/nxp_sdk.gni new file mode 100644 index 00000000000000..0fb6234c7d5aaf --- /dev/null +++ b/build_overrides/nxp_sdk.gni @@ -0,0 +1,18 @@ +# 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. + +declare_args() { + # Root directory for NXP SDKs. + nxp_sdk_build_root = "//third_party/nxp" +} diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 00bfed5df9b124..43a766b7dbf8dd 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -96,6 +96,22 @@ menu "CHIP Core" help Link the application against CHIP interactive shell. + config CHIP_SHELL_CMD_LINE_BUF_MAX_LENGTH + int "Maximum command line buffer length of the chip shell" + depends on ENABLE_CHIP_SHELL + default 256 + help + Maximum command line buffer length of the chip shell. The command strings might be received + incompletely in the command handlers if they are longer than this buffer length. + + config CHIP_SHELL_CMD_LINE_ARG_MAX_COUNT + int "Maximum command line arguments count of the chip shell" + depends on ENABLE_CHIP_SHELL + default 32 + help + Maximum command line arguments count of the chip shell. The command arguments might be ignored + if they are more than this count. + config ENABLE_CHIP_CONTROLLER_BUILD bool "Enable chip-controller build" default n diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 522b52f8b7fe3d..9b5a1e7aee9029 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -267,4 +267,13 @@ choice CHIP_LAST_FABRIC_REMOVED_ACTION endchoice +config CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY + int "After removing the last fabric wait defined time [in milliseconds] to perform an action" + depends on !CHIP_LAST_FABRIC_REMOVED_NONE + default 500 + help + After removing the last fabric the device will wait for the defined time and then perform + an action chosen by the CHIP_LAST_FABRIC_REMOVED_ACTION option. This schedule will allow for + avoiding race conditions before the device removes non-volatile data. + endif # CHIP diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 6a1a2393b8627a..e9d506e538f131 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -160,6 +160,14 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(EXISTS "${CHIP_ROOT}/config/telink/app/bootloader.conf") set(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE "${CHIP_ROOT}/config/telink/app/bootloader.conf") else() @@ -177,7 +185,7 @@ if (CONFIG_BOOTLOADER_MCUBOOT) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr - -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}" + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${FLASH_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}" COMMAND cp ${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin ${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin ) diff --git a/config/tizen/chip-gn/platform/BUILD.gn b/config/tizen/chip-gn/platform/BUILD.gn index 7d2f25e9bcf4f8..bea16af373fd15 100644 --- a/config/tizen/chip-gn/platform/BUILD.gn +++ b/config/tizen/chip-gn/platform/BUILD.gn @@ -20,6 +20,10 @@ import("${chip_root}/config/tizen/chip-gn/args.gni") import("${build_root}/config/linux/pkg_config.gni") import("${chip_root}/src/platform/device.gni") +pkg_config("capi-system-peripheral-io") { + packages = [ "capi-system-peripheral-io" ] +} + pkg_config("dlog") { packages = [ "dlog" ] } @@ -69,6 +73,7 @@ source_set("tizen") { ":glib", ":capi-appfw-preference", ":capi-system-info", + ":capi-system-peripheral-io", ] if (chip_mdns == "platform") { diff --git a/credentials/development/commissioner_dut/struct_dac_ext_key_usage_dig_sig_wrong/test_case_vector.json b/credentials/development/commissioner_dut/struct_dac_ext_key_usage_dig_sig_wrong/test_case_vector.json index 212a0ac5f3935d..9fe2a05cdd2a71 100644 --- a/credentials/development/commissioner_dut/struct_dac_ext_key_usage_dig_sig_wrong/test_case_vector.json +++ b/credentials/development/commissioner_dut/struct_dac_ext_key_usage_dig_sig_wrong/test_case_vector.json @@ -1,5 +1,5 @@ { - "description": "DAC Test Vector: Certificate Key Usage extension diginalSignature field is wrong (not present for DAC and present for PAI, which is OK as optional)", + "description": "DAC Test Vector: Certificate Key Usage extension digitalSignature field is wrong (not present for DAC and present for PAI, which is OK as optional)", "is_success_case": "false", "dac_cert": "308201cd30820174a0030201020208611516cb5e8ce57b300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313020170d3232303932333030303030305a180f39393939313233313233353935395a30463118301606035504030c0f4d617474657220546573742044414331143012060a2b0601040182a27c02010c044646463131143012060a2b0601040182a27c02020c04383030303059301306072a8648ce3d020106082a8648ce3d0301070342000445b50fdfe1cc48523ea80ea86773611d507fd6d7df96b97a00e65118e908b2e8de80de34522efa043671c42648b8d1ad5d4d497f2b68bb275a7d5ef5cc977439a360305e300c0603551d130101ff04023000300e0603551d0f0101ff040403020520301d0603551d0e04160414f3bc17e68fbb09ff2a77f7f06499b32b91d74d01301f0603551d23041830168014a66e9305a0a0bdfe507e29ae9e2e0fa9ed61c920300a06082a8648ce3d040302034700304402205352aed11ca8a49ab9fd1221cde5ef90a993f78af55480afce070ee92888069802202e40e6757b97f9a55aa6a7b2048b20a3537a27876b111e0eb2b321724d92ecfc", "pai_cert": "308201bd30820164a00302010202085ced6956be8aa63b300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414131143012060a2b0601040182a27c02010c04464646313020170d3232303932333030303030305a180f39393939313233313233353935395a30303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313059301306072a8648ce3d020106082a8648ce3d03010703420004cf18213b48c9bf7301785414ccde69bd6ac7212ccae0f41fd4d67b3b658d36f60a60978ab7522b3899c815fe374795e7a994d6d11ebfc2403210599fb778e97da366306430120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020106301d0603551d0e04160414a66e9305a0a0bdfe507e29ae9e2e0fa9ed61c920301f0603551d230418301680146afd22771f511fecbf1641976710dcdc31a1717e300a06082a8648ce3d040302034700304402205ce2d4931c0f16df3ee2d7b7c0566e103aff4d5a975c139ca926a781da50a3f002205e56862b0376d06f4379519b19e3731f21aa287292816baffe1570031aa50656", diff --git a/credentials/development/commissioner_dut/struct_pai_ext_key_usage_dig_sig_wrong/test_case_vector.json b/credentials/development/commissioner_dut/struct_pai_ext_key_usage_dig_sig_wrong/test_case_vector.json index e922c6bdd8adb3..d24649ef06d780 100644 --- a/credentials/development/commissioner_dut/struct_pai_ext_key_usage_dig_sig_wrong/test_case_vector.json +++ b/credentials/development/commissioner_dut/struct_pai_ext_key_usage_dig_sig_wrong/test_case_vector.json @@ -1,5 +1,5 @@ { - "description": "PAI Test Vector: Certificate Key Usage extension diginalSignature field is wrong (not present for DAC and present for PAI, which is OK as optional)", + "description": "PAI Test Vector: Certificate Key Usage extension digitalSignature field is wrong (not present for DAC and present for PAI, which is OK as optional)", "is_success_case": "true", "dac_cert": "308201ce30820174a0030201020208568288cb4b319ee2300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313020170d3232303932333030303030305a180f39393939313233313233353935395a30463118301606035504030c0f4d617474657220546573742044414331143012060a2b0601040182a27c02010c044646463131143012060a2b0601040182a27c02020c04383030303059301306072a8648ce3d020106082a8648ce3d0301070342000491d6c7888cf88fe930493409a59e9bffcb7da6dfe8a24fef4366368171c407d4ab2cadc2a4d3aedf78f86034b510644795e8d60503f3393024102ef1bb3445d6a360305e300c0603551d130101ff04023000300e0603551d0f0101ff040403020780301d0603551d0e04160414ce4916a3fb7cca300ed9b27bcfa6c52b32ace0ee301f0603551d230418301680146501d5f9b760746c421ffa03f40ee1233d87bad3300a06082a8648ce3d04030203480030450220273649bfb1b74c74a583f18b43dc0e998c8187b0862d4d8b7ecd4a38d76db1a90221009f8f26312ef21f1525ab3b1872c2601acb73543b97aba395111c4604b388d1a4", "pai_cert": "308201bf30820164a00302010202085067032f9c6011dc300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414131143012060a2b0601040182a27c02010c04464646313020170d3232303932333030303030305a180f39393939313233313233353935395a30303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313059301306072a8648ce3d020106082a8648ce3d0301070342000407e035085865ff28c03934454eaa22dc1c4f36c0844f1d7c7ffaaeacfba0e777efa63547f59a4384448841476d9955f943372f43aa7d498c128dac0b3ac5b362a366306430120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020186301d0603551d0e041604146501d5f9b760746c421ffa03f40ee1233d87bad3301f0603551d230418301680146afd22771f511fecbf1641976710dcdc31a1717e300a06082a8648ce3d0403020349003046022100c4cc07bb7c45d705406ff6d3b7ee858cec34822d97ded78593387bd708a0f219022100b5a010d2b5695dcee2ce4f4f3fe7fb0765671b4c29a556fc773575002c5c4235", diff --git a/credentials/development/gen_commissioner_dut_test_plan_table.py b/credentials/development/gen_commissioner_dut_test_plan_table.py index d8887a2f86f331..fb3ca49087e0b7 100755 --- a/credentials/development/gen_commissioner_dut_test_plan_table.py +++ b/credentials/development/gen_commissioner_dut_test_plan_table.py @@ -79,7 +79,7 @@ def main(): success_cases = [] failure_cases = [] - for p in os.listdir(cert_path): + for p in sorted(os.listdir(cert_path)): if p in skip_cases: continue path = str(os.path.join(cert_path, p, 'test_case_vector.json')) diff --git a/data_model/README.md b/data_model/README.md new file mode 100644 index 00000000000000..ada763cd7f2804 --- /dev/null +++ b/data_model/README.md @@ -0,0 +1,27 @@ +## Contents + +This folder contains a machine-readable representation of matter clusters. + +The XML files inside `clusters` are generated by a `scraper` script out of the +original specification `AsciiDoc` files. + +## How to update + +The matter specification is not currently public. As such, as script exists to +update the spec XML files, however this is not done automatically. + +You will require access to the following tools locally: + +- `scraper`. A binary copy generally available + [here](https://github.com/csa-data-model/projects/tree/main/DM-Editor/bin/1.2.0/scrape) +- Specification repository checkout from + https://github.com/CHIP-Specifications/connectedhomeip-spec + +Example usage: + +```sh +./scripts/spec_xml/generate_spec_xml.py \ + --scraper ~/Downloads/scrape-adoc-linux \ + --spec-root ~/work/connectedhomeip-spec \ + --output-dir data_model +``` diff --git a/data_model/clusters/ACL-Cluster.xml b/data_model/clusters/ACL-Cluster.xml new file mode 100644 index 00000000000000..2cbcbd01c9a11a --- /dev/null +++ b/data_model/clusters/ACL-Cluster.xml @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/AccountLogin.xml b/data_model/clusters/AccountLogin.xml new file mode 100644 index 00000000000000..4add6f4189d279 --- /dev/null +++ b/data_model/clusters/AccountLogin.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/AdminCommissioningCluster.xml b/data_model/clusters/AdminCommissioningCluster.xml new file mode 100644 index 00000000000000..b2cffacf87e121 --- /dev/null +++ b/data_model/clusters/AdminCommissioningCluster.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/AirQuality.xml b/data_model/clusters/AirQuality.xml new file mode 100644 index 00000000000000..dcaf38bc586cf5 --- /dev/null +++ b/data_model/clusters/AirQuality.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/AlarmBase.xml b/data_model/clusters/AlarmBase.xml new file mode 100644 index 00000000000000..b169d4fe9be24a --- /dev/null +++ b/data_model/clusters/AlarmBase.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ApplicationBasic.xml b/data_model/clusters/ApplicationBasic.xml new file mode 100644 index 00000000000000..48ce9673675e1d --- /dev/null +++ b/data_model/clusters/ApplicationBasic.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ApplicationLauncher.xml b/data_model/clusters/ApplicationLauncher.xml new file mode 100644 index 00000000000000..91ebf6b5937446 --- /dev/null +++ b/data_model/clusters/ApplicationLauncher.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/AudioOutput.xml b/data_model/clusters/AudioOutput.xml new file mode 100644 index 00000000000000..8ace3342ce2132 --- /dev/null +++ b/data_model/clusters/AudioOutput.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/BallastConfiguration.xml b/data_model/clusters/BallastConfiguration.xml new file mode 100644 index 00000000000000..a6d553ddcc6ead --- /dev/null +++ b/data_model/clusters/BallastConfiguration.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/BasicInformationCluster.xml b/data_model/clusters/BasicInformationCluster.xml new file mode 100644 index 00000000000000..ae4e6f6661a820 --- /dev/null +++ b/data_model/clusters/BasicInformationCluster.xml @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Binding-Cluster.xml b/data_model/clusters/Binding-Cluster.xml new file mode 100644 index 00000000000000..02b2219fcd0331 --- /dev/null +++ b/data_model/clusters/Binding-Cluster.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/BooleanSensorConfiguration.xml b/data_model/clusters/BooleanSensorConfiguration.xml new file mode 100644 index 00000000000000..7321a70113087f --- /dev/null +++ b/data_model/clusters/BooleanSensorConfiguration.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/BooleanState.xml b/data_model/clusters/BooleanState.xml new file mode 100644 index 00000000000000..5b298075fbaefc --- /dev/null +++ b/data_model/clusters/BooleanState.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Channel.xml b/data_model/clusters/Channel.xml new file mode 100644 index 00000000000000..3227cf9a5a446e --- /dev/null +++ b/data_model/clusters/Channel.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ColorControl.xml b/data_model/clusters/ColorControl.xml new file mode 100644 index 00000000000000..142e1a58ab7a67 --- /dev/null +++ b/data_model/clusters/ColorControl.xml @@ -0,0 +1,1023 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ConcentrationMeasurement.xml b/data_model/clusters/ConcentrationMeasurement.xml new file mode 100644 index 00000000000000..ad239e700eacf9 --- /dev/null +++ b/data_model/clusters/ConcentrationMeasurement.xml @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ContentAppObserver.xml b/data_model/clusters/ContentAppObserver.xml new file mode 100644 index 00000000000000..05d19307fc59ac --- /dev/null +++ b/data_model/clusters/ContentAppObserver.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ContentControl.xml b/data_model/clusters/ContentControl.xml new file mode 100644 index 00000000000000..3642777b46a76d --- /dev/null +++ b/data_model/clusters/ContentControl.xml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ContentLauncher.xml b/data_model/clusters/ContentLauncher.xml new file mode 100644 index 00000000000000..32b47a77c233a3 --- /dev/null +++ b/data_model/clusters/ContentLauncher.xml @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DemandResponseLoadControl.xml b/data_model/clusters/DemandResponseLoadControl.xml new file mode 100644 index 00000000000000..caa967bb9edb1e --- /dev/null +++ b/data_model/clusters/DemandResponseLoadControl.xml @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Descriptor-Cluster.xml b/data_model/clusters/Descriptor-Cluster.xml new file mode 100644 index 00000000000000..956fb411e91a22 --- /dev/null +++ b/data_model/clusters/Descriptor-Cluster.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DeviceEnergyManagement.xml b/data_model/clusters/DeviceEnergyManagement.xml new file mode 100644 index 00000000000000..f1c5c37d1ade35 --- /dev/null +++ b/data_model/clusters/DeviceEnergyManagement.xml @@ -0,0 +1,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticLogsCluster.xml b/data_model/clusters/DiagnosticLogsCluster.xml new file mode 100644 index 00000000000000..2fb6fc298ac7b5 --- /dev/null +++ b/data_model/clusters/DiagnosticLogsCluster.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticsEthernet.xml b/data_model/clusters/DiagnosticsEthernet.xml new file mode 100644 index 00000000000000..0ceb98841a7793 --- /dev/null +++ b/data_model/clusters/DiagnosticsEthernet.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticsGeneral.xml b/data_model/clusters/DiagnosticsGeneral.xml new file mode 100644 index 00000000000000..ea4ce75cd549d9 --- /dev/null +++ b/data_model/clusters/DiagnosticsGeneral.xml @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticsSoftware.xml b/data_model/clusters/DiagnosticsSoftware.xml new file mode 100644 index 00000000000000..4a4d5508be51d5 --- /dev/null +++ b/data_model/clusters/DiagnosticsSoftware.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticsThread.xml b/data_model/clusters/DiagnosticsThread.xml new file mode 100644 index 00000000000000..2f8e97b150ffc2 --- /dev/null +++ b/data_model/clusters/DiagnosticsThread.xml @@ -0,0 +1,691 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DiagnosticsWiFi.xml b/data_model/clusters/DiagnosticsWiFi.xml new file mode 100644 index 00000000000000..ce0d8ae0e59c0f --- /dev/null +++ b/data_model/clusters/DiagnosticsWiFi.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DishwasherAlarm.xml b/data_model/clusters/DishwasherAlarm.xml new file mode 100644 index 00000000000000..487a522a661af7 --- /dev/null +++ b/data_model/clusters/DishwasherAlarm.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/DoorLock.xml b/data_model/clusters/DoorLock.xml new file mode 100644 index 00000000000000..a0c5f9e63be3d7 --- /dev/null +++ b/data_model/clusters/DoorLock.xml @@ -0,0 +1,2296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Attributes.xml b/data_model/clusters/EVSE-Attributes.xml new file mode 100644 index 00000000000000..70cada7e3a902e --- /dev/null +++ b/data_model/clusters/EVSE-Attributes.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Classification.xml b/data_model/clusters/EVSE-Classification.xml new file mode 100644 index 00000000000000..6230a083a794e7 --- /dev/null +++ b/data_model/clusters/EVSE-Classification.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-ClusterID.xml b/data_model/clusters/EVSE-ClusterID.xml new file mode 100644 index 00000000000000..071dbf680e7514 --- /dev/null +++ b/data_model/clusters/EVSE-ClusterID.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Commands.xml b/data_model/clusters/EVSE-Commands.xml new file mode 100644 index 00000000000000..f170a002aab7ac --- /dev/null +++ b/data_model/clusters/EVSE-Commands.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-DataTypes.xml b/data_model/clusters/EVSE-DataTypes.xml new file mode 100644 index 00000000000000..ec95fd5c8a4eac --- /dev/null +++ b/data_model/clusters/EVSE-DataTypes.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Definitions.xml b/data_model/clusters/EVSE-Definitions.xml new file mode 100644 index 00000000000000..5d07abc25605cb --- /dev/null +++ b/data_model/clusters/EVSE-Definitions.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Dependencies.xml b/data_model/clusters/EVSE-Dependencies.xml new file mode 100644 index 00000000000000..1797d04b915b7b --- /dev/null +++ b/data_model/clusters/EVSE-Dependencies.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Events.xml b/data_model/clusters/EVSE-Events.xml new file mode 100644 index 00000000000000..75c8a89274da20 --- /dev/null +++ b/data_model/clusters/EVSE-Events.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-Features.xml b/data_model/clusters/EVSE-Features.xml new file mode 100644 index 00000000000000..ff1feadf386690 --- /dev/null +++ b/data_model/clusters/EVSE-Features.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/EVSE-RevisionHistory.xml b/data_model/clusters/EVSE-RevisionHistory.xml new file mode 100644 index 00000000000000..def04a641bf6f7 --- /dev/null +++ b/data_model/clusters/EVSE-RevisionHistory.xml @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/ElectricalEnergyMeasurement.xml b/data_model/clusters/ElectricalEnergyMeasurement.xml new file mode 100644 index 00000000000000..0047f948298a95 --- /dev/null +++ b/data_model/clusters/ElectricalEnergyMeasurement.xml @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ElectricalPowerMeasurement.xml b/data_model/clusters/ElectricalPowerMeasurement.xml new file mode 100644 index 00000000000000..0839bd569c8eb7 --- /dev/null +++ b/data_model/clusters/ElectricalPowerMeasurement.xml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/EnergyCalendar.xml b/data_model/clusters/EnergyCalendar.xml new file mode 100644 index 00000000000000..058019da1e9f8c --- /dev/null +++ b/data_model/clusters/EnergyCalendar.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/EnergyPreference.xml b/data_model/clusters/EnergyPreference.xml new file mode 100644 index 00000000000000..710ab52291b85a --- /dev/null +++ b/data_model/clusters/EnergyPreference.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/EnergyPrice.xml b/data_model/clusters/EnergyPrice.xml new file mode 100644 index 00000000000000..8be42c25061937 --- /dev/null +++ b/data_model/clusters/EnergyPrice.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/FanControl.xml b/data_model/clusters/FanControl.xml new file mode 100644 index 00000000000000..121f954055bcfe --- /dev/null +++ b/data_model/clusters/FanControl.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/FlowMeasurement.xml b/data_model/clusters/FlowMeasurement.xml new file mode 100644 index 00000000000000..66ad022c2c64ef --- /dev/null +++ b/data_model/clusters/FlowMeasurement.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/GeneralCommissioningCluster.xml b/data_model/clusters/GeneralCommissioningCluster.xml new file mode 100644 index 00000000000000..a25cdfc6ac934e --- /dev/null +++ b/data_model/clusters/GeneralCommissioningCluster.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Group-Key-Management-Cluster.xml b/data_model/clusters/Group-Key-Management-Cluster.xml new file mode 100644 index 00000000000000..78db5376ebef14 --- /dev/null +++ b/data_model/clusters/Group-Key-Management-Cluster.xml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Groups.xml b/data_model/clusters/Groups.xml new file mode 100644 index 00000000000000..175c9caf26a435 --- /dev/null +++ b/data_model/clusters/Groups.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Identify.xml b/data_model/clusters/Identify.xml new file mode 100644 index 00000000000000..cc9bf06b474eca --- /dev/null +++ b/data_model/clusters/Identify.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/IlluminanceMeasurement.xml b/data_model/clusters/IlluminanceMeasurement.xml new file mode 100644 index 00000000000000..c9be9fa6879293 --- /dev/null +++ b/data_model/clusters/IlluminanceMeasurement.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/KeypadInput.xml b/data_model/clusters/KeypadInput.xml new file mode 100644 index 00000000000000..81f16ec0830aef --- /dev/null +++ b/data_model/clusters/KeypadInput.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Label-Cluster-FixedLabel.xml b/data_model/clusters/Label-Cluster-FixedLabel.xml new file mode 100644 index 00000000000000..7087883e611edb --- /dev/null +++ b/data_model/clusters/Label-Cluster-FixedLabel.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Label-Cluster-Label.xml b/data_model/clusters/Label-Cluster-Label.xml new file mode 100644 index 00000000000000..6b29c2cf44caad --- /dev/null +++ b/data_model/clusters/Label-Cluster-Label.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Label-Cluster-UserLabel.xml b/data_model/clusters/Label-Cluster-UserLabel.xml new file mode 100644 index 00000000000000..e9d8dda4610b4f --- /dev/null +++ b/data_model/clusters/Label-Cluster-UserLabel.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LaundryDryerControls.xml b/data_model/clusters/LaundryDryerControls.xml new file mode 100644 index 00000000000000..70c985ae3fde74 --- /dev/null +++ b/data_model/clusters/LaundryDryerControls.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LaundryWasherControls.xml b/data_model/clusters/LaundryWasherControls.xml new file mode 100644 index 00000000000000..1e033da5dd88ab --- /dev/null +++ b/data_model/clusters/LaundryWasherControls.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LevelControl.xml b/data_model/clusters/LevelControl.xml new file mode 100644 index 00000000000000..7716ce228b3fad --- /dev/null +++ b/data_model/clusters/LevelControl.xml @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LocalizationConfiguration.xml b/data_model/clusters/LocalizationConfiguration.xml new file mode 100644 index 00000000000000..2b1297fb8f8e0e --- /dev/null +++ b/data_model/clusters/LocalizationConfiguration.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LocalizationTimeFormat.xml b/data_model/clusters/LocalizationTimeFormat.xml new file mode 100644 index 00000000000000..9c0ffa062fec58 --- /dev/null +++ b/data_model/clusters/LocalizationTimeFormat.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LocalizationUnit.xml b/data_model/clusters/LocalizationUnit.xml new file mode 100644 index 00000000000000..8a5179dafb0aff --- /dev/null +++ b/data_model/clusters/LocalizationUnit.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/LowPower.xml b/data_model/clusters/LowPower.xml new file mode 100644 index 00000000000000..f8ee432eef58a7 --- /dev/null +++ b/data_model/clusters/LowPower.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/MediaInput.xml b/data_model/clusters/MediaInput.xml new file mode 100644 index 00000000000000..8b6f4008f372f6 --- /dev/null +++ b/data_model/clusters/MediaInput.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/MediaPlayback.xml b/data_model/clusters/MediaPlayback.xml new file mode 100644 index 00000000000000..21001d287f6120 --- /dev/null +++ b/data_model/clusters/MediaPlayback.xml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Messages.xml b/data_model/clusters/Messages.xml new file mode 100644 index 00000000000000..71e522a92a959d --- /dev/null +++ b/data_model/clusters/Messages.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/MicrowaveOvenControl.xml b/data_model/clusters/MicrowaveOvenControl.xml new file mode 100644 index 00000000000000..e97821db771a77 --- /dev/null +++ b/data_model/clusters/MicrowaveOvenControl.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ModeBase.xml b/data_model/clusters/ModeBase.xml new file mode 100644 index 00000000000000..258708ba96908b --- /dev/null +++ b/data_model/clusters/ModeBase.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ModeSelect.xml b/data_model/clusters/ModeSelect.xml new file mode 100644 index 00000000000000..2fff860458f0e5 --- /dev/null +++ b/data_model/clusters/ModeSelect.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_Dishwasher.xml b/data_model/clusters/Mode_Dishwasher.xml new file mode 100644 index 00000000000000..22d0fab7897696 --- /dev/null +++ b/data_model/clusters/Mode_Dishwasher.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_EVSE.xml b/data_model/clusters/Mode_EVSE.xml new file mode 100644 index 00000000000000..d52139252d014d --- /dev/null +++ b/data_model/clusters/Mode_EVSE.xml @@ -0,0 +1,63 @@ + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_Laundry.xml b/data_model/clusters/Mode_Laundry.xml new file mode 100644 index 00000000000000..63108a01aa876b --- /dev/null +++ b/data_model/clusters/Mode_Laundry.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_LaundryWasher.xml b/data_model/clusters/Mode_LaundryWasher.xml new file mode 100644 index 00000000000000..96190a4009850c --- /dev/null +++ b/data_model/clusters/Mode_LaundryWasher.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_MicrowaveOven.xml b/data_model/clusters/Mode_MicrowaveOven.xml new file mode 100644 index 00000000000000..d1ac9458d71af8 --- /dev/null +++ b/data_model/clusters/Mode_MicrowaveOven.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_Oven.xml b/data_model/clusters/Mode_Oven.xml new file mode 100644 index 00000000000000..56a369dd425572 --- /dev/null +++ b/data_model/clusters/Mode_Oven.xml @@ -0,0 +1,63 @@ + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_RVCClean.xml b/data_model/clusters/Mode_RVCClean.xml new file mode 100644 index 00000000000000..b82c26501f1196 --- /dev/null +++ b/data_model/clusters/Mode_RVCClean.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_RVCRun.xml b/data_model/clusters/Mode_RVCRun.xml new file mode 100644 index 00000000000000..f1b8b58c69e068 --- /dev/null +++ b/data_model/clusters/Mode_RVCRun.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_Refrigerator.xml b/data_model/clusters/Mode_Refrigerator.xml new file mode 100644 index 00000000000000..cf6a65721e0efd --- /dev/null +++ b/data_model/clusters/Mode_Refrigerator.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_WaterHeater.xml b/data_model/clusters/Mode_WaterHeater.xml new file mode 100644 index 00000000000000..535eb4d22dd7c7 --- /dev/null +++ b/data_model/clusters/Mode_WaterHeater.xml @@ -0,0 +1,63 @@ + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/NetworkCommissioningCluster.xml b/data_model/clusters/NetworkCommissioningCluster.xml new file mode 100644 index 00000000000000..0e6703b896380a --- /dev/null +++ b/data_model/clusters/NetworkCommissioningCluster.xml @@ -0,0 +1,511 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/NetworkIdentityManagement.xml b/data_model/clusters/NetworkIdentityManagement.xml new file mode 100644 index 00000000000000..9ce28aa194426b --- /dev/null +++ b/data_model/clusters/NetworkIdentityManagement.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OTASoftwareUpdate.xml b/data_model/clusters/OTASoftwareUpdate.xml new file mode 100644 index 00000000000000..2c87e6aa1039c9 --- /dev/null +++ b/data_model/clusters/OTASoftwareUpdate.xml @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/OccupancySensing.xml b/data_model/clusters/OccupancySensing.xml new file mode 100644 index 00000000000000..1dd5cbe6156865 --- /dev/null +++ b/data_model/clusters/OccupancySensing.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OnOff.xml b/data_model/clusters/OnOff.xml new file mode 100644 index 00000000000000..3c79220ecd67fc --- /dev/null +++ b/data_model/clusters/OnOff.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OperationalCredentialCluster.xml b/data_model/clusters/OperationalCredentialCluster.xml new file mode 100644 index 00000000000000..a5d25d07d57ecc --- /dev/null +++ b/data_model/clusters/OperationalCredentialCluster.xml @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OperationalState.xml b/data_model/clusters/OperationalState.xml new file mode 100644 index 00000000000000..5e969ff0793b5a --- /dev/null +++ b/data_model/clusters/OperationalState.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OperationalState_Oven.xml b/data_model/clusters/OperationalState_Oven.xml new file mode 100644 index 00000000000000..785b72498b326d --- /dev/null +++ b/data_model/clusters/OperationalState_Oven.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/OperationalState_RVC.xml b/data_model/clusters/OperationalState_RVC.xml new file mode 100644 index 00000000000000..3a2fa80b2857e2 --- /dev/null +++ b/data_model/clusters/OperationalState_RVC.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/PowerSourceCluster.xml b/data_model/clusters/PowerSourceCluster.xml new file mode 100644 index 00000000000000..f7b5da82ce20fc --- /dev/null +++ b/data_model/clusters/PowerSourceCluster.xml @@ -0,0 +1,1064 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/PowerSourceConfigurationCluster.xml b/data_model/clusters/PowerSourceConfigurationCluster.xml new file mode 100644 index 00000000000000..d186842379aaf6 --- /dev/null +++ b/data_model/clusters/PowerSourceConfigurationCluster.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/PressureMeasurement.xml b/data_model/clusters/PressureMeasurement.xml new file mode 100644 index 00000000000000..70093485639090 --- /dev/null +++ b/data_model/clusters/PressureMeasurement.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/PumpConfigurationControl.xml b/data_model/clusters/PumpConfigurationControl.xml new file mode 100644 index 00000000000000..095004ff01bf7e --- /dev/null +++ b/data_model/clusters/PumpConfigurationControl.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/RefrigeratorAlarm.xml b/data_model/clusters/RefrigeratorAlarm.xml new file mode 100644 index 00000000000000..5c2ea3c6853c20 --- /dev/null +++ b/data_model/clusters/RefrigeratorAlarm.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ResourceMonitoring.xml b/data_model/clusters/ResourceMonitoring.xml new file mode 100644 index 00000000000000..e5a178a5700f8c --- /dev/null +++ b/data_model/clusters/ResourceMonitoring.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Scenes.xml b/data_model/clusters/Scenes.xml new file mode 100644 index 00000000000000..07a15de02bc7a4 --- /dev/null +++ b/data_model/clusters/Scenes.xml @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/SmokeCOAlarm.xml b/data_model/clusters/SmokeCOAlarm.xml new file mode 100644 index 00000000000000..d24f696e3a3384 --- /dev/null +++ b/data_model/clusters/SmokeCOAlarm.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Switch.xml b/data_model/clusters/Switch.xml new file mode 100644 index 00000000000000..141b32e782969d --- /dev/null +++ b/data_model/clusters/Switch.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/TargetNavigator.xml b/data_model/clusters/TargetNavigator.xml new file mode 100644 index 00000000000000..3a49e7b5c6c838 --- /dev/null +++ b/data_model/clusters/TargetNavigator.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/TemperatureControl.xml b/data_model/clusters/TemperatureControl.xml new file mode 100644 index 00000000000000..f457238bab1d8a --- /dev/null +++ b/data_model/clusters/TemperatureControl.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/TemperatureMeasurement.xml b/data_model/clusters/TemperatureMeasurement.xml new file mode 100644 index 00000000000000..e1603fd3358bc3 --- /dev/null +++ b/data_model/clusters/TemperatureMeasurement.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Thermostat.xml b/data_model/clusters/Thermostat.xml new file mode 100644 index 00000000000000..704d3a21a1df9a --- /dev/null +++ b/data_model/clusters/Thermostat.xml @@ -0,0 +1,913 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ThermostatUserInterfaceConfiguration.xml b/data_model/clusters/ThermostatUserInterfaceConfiguration.xml new file mode 100644 index 00000000000000..6c8d1d920e6ef7 --- /dev/null +++ b/data_model/clusters/ThermostatUserInterfaceConfiguration.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ThreadBorderRouterDiagnostics.xml b/data_model/clusters/ThreadBorderRouterDiagnostics.xml new file mode 100644 index 00000000000000..20215e275d2f00 --- /dev/null +++ b/data_model/clusters/ThreadBorderRouterDiagnostics.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/TimeSync.xml b/data_model/clusters/TimeSync.xml new file mode 100644 index 00000000000000..c7ad7b0032aaf7 --- /dev/null +++ b/data_model/clusters/TimeSync.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Timer.xml b/data_model/clusters/Timer.xml new file mode 100644 index 00000000000000..f4e37a2b60ceb6 --- /dev/null +++ b/data_model/clusters/Timer.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/ValveConfigurationControl.xml b/data_model/clusters/ValveConfigurationControl.xml new file mode 100644 index 00000000000000..74ed2f4df40597 --- /dev/null +++ b/data_model/clusters/ValveConfigurationControl.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/WakeOnLAN.xml b/data_model/clusters/WakeOnLAN.xml new file mode 100644 index 00000000000000..eede336182e6dc --- /dev/null +++ b/data_model/clusters/WakeOnLAN.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/WaterContentMeasurement.xml b/data_model/clusters/WaterContentMeasurement.xml new file mode 100644 index 00000000000000..8b1ff6a9a049bc --- /dev/null +++ b/data_model/clusters/WaterContentMeasurement.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/WaterHeaterManagement.xml b/data_model/clusters/WaterHeaterManagement.xml new file mode 100644 index 00000000000000..c55c6a1e09bf09 --- /dev/null +++ b/data_model/clusters/WaterHeaterManagement.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/WiFiPerDeviceCredentials.xml b/data_model/clusters/WiFiPerDeviceCredentials.xml new file mode 100644 index 00000000000000..807ea27c64053b --- /dev/null +++ b/data_model/clusters/WiFiPerDeviceCredentials.xml @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/WindowCovering.xml b/data_model/clusters/WindowCovering.xml new file mode 100644 index 00000000000000..7eefe853c91d0a --- /dev/null +++ b/data_model/clusters/WindowCovering.xml @@ -0,0 +1,694 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/bridge-clusters-Actions.xml b/data_model/clusters/bridge-clusters-Actions.xml new file mode 100644 index 00000000000000..f9b17944739dca --- /dev/null +++ b/data_model/clusters/bridge-clusters-Actions.xml @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/bridge-clusters-BridgedDeviceBasicInformation.xml b/data_model/clusters/bridge-clusters-BridgedDeviceBasicInformation.xml new file mode 100644 index 00000000000000..038d7a7f4112c5 --- /dev/null +++ b/data_model/clusters/bridge-clusters-BridgedDeviceBasicInformation.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/energy_management.xml b/data_model/clusters/energy_management.xml new file mode 100644 index 00000000000000..792560796cdd4d --- /dev/null +++ b/data_model/clusters/energy_management.xml @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/data_model/clusters/network_infrastructure.xml b/data_model/clusters/network_infrastructure.xml new file mode 100644 index 00000000000000..181ee350003454 --- /dev/null +++ b/data_model/clusters/network_infrastructure.xml @@ -0,0 +1,62 @@ + + + \ No newline at end of file diff --git a/data_model/spec_sha b/data_model/spec_sha new file mode 100644 index 00000000000000..c8cdb81dba2809 --- /dev/null +++ b/data_model/spec_sha @@ -0,0 +1 @@ +6be044cb0a9bb333b70ccf9f70074afeb440b3cb diff --git a/docs/examples/index.md b/docs/examples/index.md index e5144f81885039..c6d211bcaeee9d 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -303,7 +303,7 @@ window-app/**/README resource-monitoring-app/**/README ``` -## Air Quality Sensor example +## RVC example ```{toctree} :glob: @@ -311,3 +311,12 @@ resource-monitoring-app/**/README rvc-app/README ``` + +## Air Purifier Example + +```{toctree} +:glob: +:maxdepth: 1 + +air-purifier-app/**/README +``` diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/guides/nrfconnect_factory_data_configuration.md index 1cc4bf01adccfb..d30a12f1e82025 100644 --- a/docs/guides/nrfconnect_factory_data_configuration.md +++ b/docs/guides/nrfconnect_factory_data_configuration.md @@ -247,7 +247,7 @@ To use this script, complete the following steps: b. Add output file path: ``` - -o + -o ``` c. Generate SPAKE2 verifier using one of the following methods: @@ -357,7 +357,7 @@ $ python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py \ --passcode 20202021 \ --product_finish "matte" \ --product_color "black" \ ---out "build.json"' \ +--out "build.json" \ --schema "scripts/tools/nrfconnect/nrfconnect_factory_data.schema" ``` diff --git a/docs/guides/nxp_rw61x_ota_software_update.md b/docs/guides/nxp_rw61x_ota_software_update.md new file mode 100644 index 00000000000000..c3bd5227a054ed --- /dev/null +++ b/docs/guides/nxp_rw61x_ota_software_update.md @@ -0,0 +1,268 @@ +# Matter Over-The-Air Software Update with NXP RW61x example applications + +## Overview + +The OTA Requestor feature enables the device to be informed of, download and +apply a software update from an OTA Provider. + +This section explains how to perform an OTA Software Update with NXP RW61x +example applications. Throughout this guide, the all-clusters application is +used as an example. + +In general, the Over-The-Air Software Update process consists of the following +steps : + +- The OTA Requestor queries an update image from the OTA Provider which + responds according to its availability. +- The update image is received in blocks and stored in the external flash of + the device. +- Once the update image is fully downloaded, the bootloader is notified and + the device resets applying the update in test-mode. +- If the test is successful, the update is applied permanently. Otherwise, the + bootloader reverts back to the primary application, preventing any + downgrade. + +### Flash Memory Layout + +The RW61x Flash is divided into different regions as follow : + +- Bootloader : MCUBoot resides at the base of the flash and occupies 0x20000 + (128 kB). +- Primary application partition : The example application which would be run + by the bootloader (active application). The size reserved for this partition + is 4.4 MB. +- Secondary application partition : Update image received with the OTA + (candidate application). The size reserved for the partition is 4.4 MB. + +Notes : + +- The CPU1/CPU2 firmware are embedded in the CPU3 example application. +- The sizes of the primary and secondary applications are provided as an + example (currently 4.4 MB is reserved for each partition). The size can be + changed by modifying the `m_app_max_sectors` value in the linker script of + the application (`RW610_flash.ld`). + +### MCUBoot Bootloader + +MCUBoot is an open-source secure bootloader used by RW61x to apply the +self-upgrade. For more details, please refer to the +[MCUBoot documentation](https://github.com/mcu-tools/mcuboot/blob/main/docs/design.md). + +In our use case, the bootloader runs the application residing in the primary +partition. In order to run the OTA update image, the bootloader will swap the +content of the primary and the secondary partitions. This type of upgrade is +called swap-move and is the default upgrade configured by MCUBoot. + +## OTA Software Update process for RW61x example application + +### Flashing the bootloader + +In order for the device to perform the software update, the MCUBoot bootloader +must be flashed first at the base of the flash. A step-by-step guide is given +below. + +- It is recommended to start with erasing the external flash of the device, + for this JLink from Segger can be used. It can be downloaded and installed + from https://www.segger.com/products/debug-probes/j-link. Once installed, + JLink can be run using the command line : + +``` +$ JLink +``` + +Run the following commands : + +``` +J-Link > connect +Device> ? # you will be presented with a dialog -> select `RW612` +Please specify target interface: +J) JTAG (Default) +S) SWD +T) cJTAG +TIF> S +Specify target interface speed [kHz]. : 4000 kHz +Speed> # +J-Link > exec EnableEraseAllFlashBanks +J-Link > erase 0x8000000, 0x88a0000 +``` + +- Using MCUXPresso, import the `mcuboot_opensource` demo example from the SDK + previously downloaded. + ![mcuboot_demo](../../examples/platform/nxp/rt/rw61x/doc/images/mcuboot_demo.PNG) +- Before building the demo example, it should be specified that the + application to be run by the bootloader is monolithic. As a result, only one + image will be upgraded by the bootloader. This can be done by defining + `MONOLITHIC_APP` as 1 in the settings of the `mcuboot_opensource` project : + +``` +Right click on the Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU C Compiler -> Preprocessor -> Add "MONOLITHIC_APP=1" in the Defined Symbols +``` + +![rw610_mcuboot_monolithic](../../examples/platform/nxp/rt/rw61x/doc/images/mcuboot_monolithic_app.PNG) + +- Build the demo example project and program it to the target board. +- To run the flashed demo, either press the reset button of the device or use + the debugger IDE of MCUXpresso. If it runs successfully, the following logs + will be displayed on the terminal : + +``` +hello sbl. +Bootloader Version 1.9.0 +Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 +Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 +Boot source: none +Swap type: none +erasing trailer; fa_id=2 +Unable to find bootable image +``` + +Note : By default, mcuboot application considers the primary and secondary +partitions to be the size of 4.4 MB. If the size is to be changed, the partition +addresses should be modified in the flash_partitioning.h accordingly. For more +information about the flash partitioning with mcuboot, please refer to the +dedicated readme.txt located in +"`SDK_RW612/boards/rdrw612bga/ota_examples/mcuboot_opensource/`". + +### Generating and flashing the signed application image + +After flashing the bootloader, the application can be programmed to the board. +The image must have the following format : + +- Header : contains general information about the image (version, size, + magic...) +- Code of the application : generated binary +- Trailer : contains metadata needed by the bootloader such as the image + signature, the upgrade type, the swap status... + +The all-clusters application can be generated using the instructions from the +[README.md 'Building'](../../examples/all-clusters-app/nxp/rt/rw61x/README.md#building) +section. The application is automatically linked to be executed from the primary +image partition, taking into consideration the offset imposed by mcuboot. + +The resulting executable file found in out/debug/chip-rw61x-all-cluster-example +needs to be converted into raw binary format as shown below. + +``` +arm-none-eabi-objcopy -R .flash_config -R .NVM -O binary chip-rw61x-all-cluster-example chip-rw61x-all-cluster-example.bin +``` + +To sign the image and wrap the raw binary of the application with the header and +trailer, "`imgtool`" is provided in the SDK and can be found in +"`/middleware/mcuboot_opensource/scripts/`". + +The following commands can be run (make sure to replace the /path/to/file/binary +with the adequate files): + +``` +user@ubuntu: cd ~/Desktop/SDK_RW612/middleware/mcuboot_opensource/scripts + +user@ubuntu: python3 imgtool.py sign --key ~/Desktop/SDK_RW612/boards/rdrw612bga/ota_examples/mcuboot_opensource/keys/sign-rsa2048-priv.pem --align 4 --header-size 0x1000 --pad-header --slot-size 0x440000 --max-sectors 1088 --version "1.0" ~/Desktop/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x/out/debug/chip-rw61x-all-cluster-example.bin ~/Desktop/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x/out/debug/chip-rw61x-all-cluster-example_SIGNED.bin +``` + +Notes : + +- If internal SDK is used instead, the key can be found in : + "`~/Desktop/SDK_RW612/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-priv.pem`". +- The arguments `slot-size` and `max-sectors` should be adjusted to the size + of the partitions reserved for the primary and the secondary applications. + (By default the size considered is 4.4 MB) +- In this example, the image is signed with the private key provided by the + SDK as an example + (`/path_to_sdk/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-priv.pem`), + MCUBoot is built with its corresponding public key which would be used to + verify the integrity of the image. It is possible to generate a new pair of + keys using the following commands. This procedure should be done prior to + building the mcuboot application. + +- To generate the private key : + +``` +user@ubuntu: python3 imgtool.py keygen -k priv_key.pem -t rsa-2048 +``` + +- To extract the public key : + +``` +user@ubuntu: python3 imgtool.py getpub -k priv_key.pem +``` + +- The extracted public key can then be copied to the + `/path_to_sdk/middleware/mcuboot_opensource/boot/nxp_mcux_sdk/keys/sign-rsa2048-pub.c`, + given as a value to the rsa_pub_key[] array. + +The resulting output is the signed binary of the application version "1.0". + +JLink can be used to flash the application at the address 0x8020000, using the +command : + +``` +J-Link > loadbin chip-rw61x-all-cluster-example_SIGNED.bin 0x8020000 +``` + +The bootloader should then be able to jump directly to the start of the +application and run it. + +### Generating the OTA Update Image + +To generate the OTA update image the same procedure can be followed from the +[Generating and flashing the signed application image](#generating-and-flashing-the-signed-application-image) +sub-section, replacing the "--version "1.0"" argument with "--version "2.0"" +(recent version of the update). + +When the signed binary of the update is generated, the file should be converted +into OTA format. To do so, the ota_image_tool is provided in the repo and can be +used to convert a binary file into an .ota file. + +``` +user@ubuntu:~/connectedhomeip$ : ./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 2 -vs "2.0" -da sha256 chip-rw61x-all-cluster-example_SIGNED.bin chip-rw61x-all-cluster-example.ota +``` + +The generated OTA file can be used to perform the OTA Software Update. The +instructions below describe the procedure step-by-step. + +### Performing the OTA Software Update + +Setup example : + +- [Chip-tool](../../examples/chip-tool/README.md) application running on the + RPi. +- OTA Provider application built on the same RPi (as explained below). +- RW61x board programmed with the example application (with the instructions + above). + +Before starting the OTA process, the Linux OTA Provider application can be built +on the RPi (if not already present in the pre-installed apps) : + +``` +user@ubuntu:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false + +user@ubuntu:~/connectedhomeip$ : rm -rf /tmp/chip_* +user@ubuntu:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f chip-rw61x-all-cluster-example.ota +``` + +The OTA Provider should first be provisioned with chip-tool by assigning it the +node id 1, and then granted the ACL entries : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing onnetwork 1 20202021 +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 +``` + +The second step is to provision the device with the node id 2 using ble-wifi or +ble-thread commissioning. For example : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing ble-wifi 2 WIFI_SSID WIFI_PASSWORD 20202021 3840 +``` + +Once commissioned, the OTA process can be initiated with the +"announce-ota-provider" command using chip-tool (the given numbers refer +respectively to [ProviderNodeId][vendorid] [AnnouncementReason][endpoint] +[node-id][endpoint-id]) : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 2 0 +``` + +When the full update image is downloaded and stored, the bootloader will be +notified and the device will reboot with the update image. diff --git a/examples/air-purifier-app/air-purifier-common/BUILD.gn b/examples/air-purifier-app/air-purifier-common/BUILD.gn new file mode 100755 index 00000000000000..9715f88e65f2b3 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/BUILD.gn @@ -0,0 +1,24 @@ +# 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}/src/app/chip_data_model.gni") + +chip_data_model("air-purifier-common") { + zap_file = "air-purifier-app.zap" + + zap_pregenerated_dir = + "${chip_root}/zzz_generated/air-purifier-app/zap-generated" + is_server = true +} diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter new file mode 100644 index 00000000000000..1f912fcd64e643 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -0,0 +1,2360 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string countryCode = 1; + int64u breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes for reporting air quality classification */ +server cluster AirQuality = 91 { + enum AirQualityEnum : enum8 { + kUnknown = 0; + kGood = 1; + kFair = 2; + kModerate = 3; + kPoor = 4; + kVeryPoor = 5; + kExtremelyPoor = 6; + } + + bitmap Feature : bitmap32 { + kFair = 0x1; + kModerate = 0x2; + kVeryPoor = 0x4; + kExtremelyPoor = 0x8; + } + + readonly attribute AirQualityEnum airQuality = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for monitoring HEPA filters in a device */ +server cluster HepaFilterMonitoring = 113 { + enum ChangeIndicationEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum DegradationDirectionEnum : enum8 { + kUp = 0; + kDown = 1; + } + + enum ProductIdentifierTypeEnum : enum8 { + kUPC = 0; + kGTIN8 = 1; + kEAN = 2; + kGTIN14 = 3; + kOEM = 4; + } + + bitmap Feature : bitmap32 { + kCondition = 0x1; + kWarning = 0x2; + kReplacementProductList = 0x4; + } + + struct ReplacementProductStruct { + ProductIdentifierTypeEnum productIdentifierType = 0; + char_string<20> productIdentifierValue = 1; + } + + readonly attribute percent condition = 0; + readonly attribute DegradationDirectionEnum degradationDirection = 1; + readonly attribute ChangeIndicationEnum changeIndication = 2; + readonly attribute boolean inPlaceIndicator = 3; + attribute nullable epoch_s lastChangedTime = 4; + readonly attribute ReplacementProductStruct replacementProductList[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCondition(): DefaultSuccess = 0; +} + +/** Attributes and commands for monitoring activated carbon filters in a device */ +server cluster ActivatedCarbonFilterMonitoring = 114 { + enum ChangeIndicationEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum DegradationDirectionEnum : enum8 { + kUp = 0; + kDown = 1; + } + + enum ProductIdentifierTypeEnum : enum8 { + kUPC = 0; + kGTIN8 = 1; + kEAN = 2; + kGTIN14 = 3; + kOEM = 4; + } + + bitmap Feature : bitmap32 { + kCondition = 0x1; + kWarning = 0x2; + kReplacementProductList = 0x4; + } + + struct ReplacementProductStruct { + ProductIdentifierTypeEnum productIdentifierType = 0; + char_string<20> productIdentifierValue = 1; + } + + readonly attribute percent condition = 0; + readonly attribute DegradationDirectionEnum degradationDirection = 1; + readonly attribute ChangeIndicationEnum changeIndication = 2; + readonly attribute boolean inPlaceIndicator = 3; + attribute nullable epoch_s lastChangedTime = 4; + readonly attribute ReplacementProductStruct replacementProductList[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCondition(): DefaultSuccess = 0; +} + +/** An interface for controlling a fan in a heating/cooling system. */ +provisional server cluster FanControl = 514 { + enum AirflowDirectionEnum : enum8 { + kForward = 0; + kReverse = 1; + } + + enum FanModeEnum : enum8 { + kOff = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kOn = 4; + kAuto = 5; + kSmart = 6; + } + + enum FanModeSequenceEnum : enum8 { + kOffLowMedHigh = 0; + kOffLowHigh = 1; + kOffLowMedHighAuto = 2; + kOffLowHighAuto = 3; + kOffOnAuto = 4; + kOffOn = 5; + } + + enum StepDirectionEnum : enum8 { + kIncrease = 0; + kDecrease = 1; + } + + bitmap Feature : bitmap32 { + kMultiSpeed = 0x1; + kAuto = 0x2; + kRocking = 0x4; + kWind = 0x8; + kStep = 0x10; + kAirflowDirection = 0x20; + } + + bitmap RockBitmap : bitmap8 { + kRockLeftRight = 0x1; + kRockUpDown = 0x2; + kRockRound = 0x4; + } + + bitmap WindBitmap : bitmap8 { + kSleepWind = 0x1; + kNaturalWind = 0x2; + } + + attribute FanModeEnum fanMode = 0; + attribute FanModeSequenceEnum fanModeSequence = 1; + attribute nullable percent percentSetting = 2; + readonly attribute percent percentCurrent = 3; + readonly attribute int8u speedMax = 4; + attribute nullable int8u speedSetting = 5; + readonly attribute int8u speedCurrent = 6; + readonly attribute RockBitmap rockSupport = 7; + attribute RockBitmap rockSetting = 8; + readonly attribute WindBitmap windSupport = 9; + attribute WindBitmap windSetting = 10; + attribute AirflowDirectionEnum airflowDirection = 11; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct StepRequest { + StepDirectionEnum direction = 0; + optional boolean wrap = 1; + optional boolean lowestOff = 2; + } + + command Step(StepRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ +server cluster TemperatureMeasurement = 1026 { + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of relative humidity, and reporting relative humidity measurements. */ +server cluster RelativeHumidityMeasurement = 1029 { + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; + readonly attribute int16u tolerance = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting carbon monoxide concentration measurements */ +server cluster CarbonMonoxideConcentrationMeasurement = 1036 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting carbon dioxide concentration measurements */ +server cluster CarbonDioxideConcentrationMeasurement = 1037 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting nitrogen dioxide concentration measurements */ +server cluster NitrogenDioxideConcentrationMeasurement = 1043 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting ozone concentration measurements */ +server cluster OzoneConcentrationMeasurement = 1045 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting PM2.5 concentration measurements */ +server cluster Pm25ConcentrationMeasurement = 1066 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting formaldehyde concentration measurements */ +server cluster FormaldehydeConcentrationMeasurement = 1067 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting PM1 concentration measurements */ +server cluster Pm1ConcentrationMeasurement = 1068 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting PM10 concentration measurements */ +server cluster Pm10ConcentrationMeasurement = 1069 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting total volatile organic compounds concentration measurements */ +server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes for reporting radon concentration measurements */ +server cluster RadonConcentrationMeasurement = 1071 { + enum LevelValueEnum : enum8 { + kUnknown = 0; + kLow = 1; + kMedium = 2; + kHigh = 3; + kCritical = 4; + } + + enum MeasurementMediumEnum : enum8 { + kAir = 0; + kWater = 1; + kSoil = 2; + } + + enum MeasurementUnitEnum : enum8 { + kPPM = 0; + kPPB = 1; + kPPT = 2; + kMGM3 = 3; + kUGM3 = 4; + kNGM3 = 5; + kPM3 = 6; + kBQM3 = 7; + } + + bitmap Feature : bitmap32 { + kNumericMeasurement = 0x1; + kLevelIndication = 0x2; + kMediumLevel = 0x4; + kCriticalLevel = 0x8; + kPeakMeasurement = 0x10; + kAverageMeasurement = 0x20; + } + + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; + callback attribute defaultOTAProviders; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command TestEventTrigger; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_air_purifier = 45, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList default = 0; + callback attribute serverList default = 0; + callback attribute clientList default = 0; + callback attribute partsList default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster HepaFilterMonitoring { + callback attribute condition default = 100; + callback attribute degradationDirection default = 1; + callback attribute changeIndication default = 0; + callback attribute inPlaceIndicator default = 1; + callback attribute lastChangedTime; + callback attribute replacementProductList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ResetCondition; + } + + server cluster ActivatedCarbonFilterMonitoring { + callback attribute condition default = 100; + callback attribute degradationDirection default = 1; + callback attribute changeIndication default = 0; + callback attribute inPlaceIndicator default = 1; + callback attribute lastChangedTime; + callback attribute replacementProductList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ResetCondition; + } + + server cluster FanControl { + ram attribute fanMode default = 0; + ram attribute fanModeSequence default = 2; + ram attribute percentSetting default = 0; + ram attribute percentCurrent default = 0; + ram attribute speedMax default = 10; + ram attribute speedSetting default = 0; + ram attribute speedCurrent default = 0; + ram attribute rockSupport default = 0x01; + ram attribute rockSetting default = 0x00; + ram attribute windSupport default = 0x03; + ram attribute windSetting default = 0x00; + ram attribute airflowDirection default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 63; + ram attribute clusterRevision default = 4; + + handle command Step; + } +} +endpoint 2 { + device type ma_air_quality_sensor = 44, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AirQuality { + callback attribute airQuality default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster CarbonMonoxideConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster CarbonDioxideConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster NitrogenDioxideConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OzoneConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster Pm25ConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster FormaldehydeConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster Pm1ConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster Pm10ConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster RadonConcentrationMeasurement { + callback attribute measuredValue; + callback attribute minMeasuredValue; + callback attribute maxMeasuredValue; + callback attribute peakMeasuredValue; + callback attribute peakMeasuredValueWindow default = 1; + callback attribute averageMeasuredValue; + callback attribute averageMeasuredValueWindow default = 1; + callback attribute uncertainty default = 0; + callback attribute measurementUnit default = 0; + callback attribute measurementMedium default = 0; + callback attribute levelValue default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } +} +endpoint 3 { + device type ma_tempsensor = 770, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster TemperatureMeasurement { + ram attribute measuredValue default = 0x8000; + ram attribute minMeasuredValue default = 0x8000; + ram attribute maxMeasuredValue default = 0x8000; + ram attribute tolerance default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } +} +endpoint 4 { + device type ma_humiditysensor = 775, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster RelativeHumidityMeasurement { + ram attribute measuredValue default = 0; + ram attribute minMeasuredValue default = 0; + ram attribute maxMeasuredValue default = 0x2710; + ram attribute tolerance; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } +} + + diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap new file mode 100644 index 00000000000000..c1f47b4d162a51 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -0,0 +1,7548 @@ +{ + "fileFormat": 2, + "featureLevel": 99, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "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": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "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": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 45, + "profileId": 259, + "label": "MA-air-purifier", + "name": "MA-air-purifier" + }, + "deviceTypes": [ + { + "code": 45, + "profileId": 259, + "label": "MA-air-purifier", + "name": "MA-air-purifier" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 45 + ], + "deviceTypeName": "MA-air-purifier", + "deviceTypeCode": 45, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "HEPA Filter Monitoring", + "code": 113, + "mfgCode": null, + "define": "HEPA_FILTER_MONITORING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCondition", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Condition", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DegradationDirection", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "DegradationDirectionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ChangeIndication", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ChangeIndicationEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InPlaceIndicator", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastChangedTime", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Activated Carbon Filter Monitoring", + "code": 114, + "mfgCode": null, + "define": "ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCondition", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Condition", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DegradationDirection", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "DegradationDirectionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ChangeIndication", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ChangeIndicationEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InPlaceIndicator", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastChangedTime", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fan Control", + "code": 514, + "mfgCode": null, + "define": "FAN_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "Step", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FanMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "FanModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FanModeSequence", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "FanModeSequenceEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PercentSetting", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PercentCurrent", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedMax", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedSetting", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RockSupport", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "RockBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RockSetting", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "RockBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WindSupport", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "WindBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x03", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WindSetting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "WindBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AirflowDirection", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "AirflowDirectionEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "63", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 44, + "profileId": 259, + "label": "MA-air-quality-sensor", + "name": "MA-air-quality-sensor" + }, + "deviceTypes": [ + { + "code": 44, + "profileId": 259, + "label": "MA-air-quality-sensor", + "name": "MA-air-quality-sensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 44 + ], + "deviceTypeName": "MA-air-quality-sensor", + "deviceTypeCode": 44, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Air Quality", + "code": 91, + "mfgCode": null, + "define": "AIR_QUALITY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "AirQuality", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AirQualityEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Carbon Monoxide Concentration Measurement", + "code": 1036, + "mfgCode": null, + "define": "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Carbon Dioxide Concentration Measurement", + "code": 1037, + "mfgCode": null, + "define": "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Nitrogen Dioxide Concentration Measurement", + "code": 1043, + "mfgCode": null, + "define": "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Ozone Concentration Measurement", + "code": 1045, + "mfgCode": null, + "define": "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "PM2.5 Concentration Measurement", + "code": 1066, + "mfgCode": null, + "define": "PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Formaldehyde Concentration Measurement", + "code": 1067, + "mfgCode": null, + "define": "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "PM1 Concentration Measurement", + "code": 1068, + "mfgCode": null, + "define": "PM1_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "PM10 Concentration Measurement", + "code": 1069, + "mfgCode": null, + "define": "PM10_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Total Volatile Organic Compounds Concentration Measurement", + "code": 1070, + "mfgCode": null, + "define": "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Radon Concentration Measurement", + "code": 1071, + "mfgCode": null, + "define": "RADON_CONCENTRATION_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValue", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PeakMeasuredValueWindow", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValue", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AverageMeasuredValueWindow", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Uncertainty", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "single", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementUnit", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "MeasurementUnitEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeasurementMedium", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "MeasurementMediumEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LevelValue", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "LevelValueEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 770, + "profileId": 259, + "label": "MA-tempsensor", + "name": "MA-tempsensor" + }, + "deviceTypes": [ + { + "code": 770, + "profileId": 259, + "label": "MA-tempsensor", + "name": "MA-tempsensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 770 + ], + "deviceTypeName": "MA-tempsensor", + "deviceTypeCode": 770, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 5, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 775, + "profileId": 259, + "label": "MA-humiditysensor", + "name": "MA-humiditysensor" + }, + "deviceTypes": [ + { + "code": 775, + "profileId": 259, + "label": "MA-humiditysensor", + "name": "MA-humiditysensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 775 + ], + "deviceTypeName": "MA-humiditysensor", + "deviceTypeCode": 775, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Relative Humidity Measurement", + "code": 1029, + "mfgCode": null, + "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2710", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 4, + "profileId": 259, + "endpointId": 4, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/air-purifier-app/air-purifier-common/include/DeviceManager.h b/examples/air-purifier-app/air-purifier-common/include/DeviceManager.h new file mode 100644 index 00000000000000..96935feb4b4448 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/DeviceManager.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class DeviceManagerCallbacks +{ +public: + virtual void PostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t type, + uint16_t size, uint8_t * value){}; + + Protocols::InteractionModel::Status PreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, + AttributeId attributeId, uint8_t type, uint16_t size, + uint8_t * value) + { + return Protocols::InteractionModel::Status::Success; + }; + + virtual ~DeviceManagerCallbacks(){}; +}; + +} // namespace DeviceManager +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/include/air-purifier-manager.h b/examples/air-purifier-app/air-purifier-common/include/air-purifier-manager.h new file mode 100644 index 00000000000000..81565d532e4e7e --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/air-purifier-manager.h @@ -0,0 +1,162 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; + +constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; + +/** + * @brief + * This class provides a singleton AIr Purifier Manager which also implements the FanControl::Delegate and the Device Callbacks. + * The class is responsible for all Air Purifier Elements on the Air Purifier Endpoint and it has members that are other Managers + * for the devices in its composition tree. + */ +class AirPurifierManager : public FanControl::Delegate, public DeviceManager::DeviceManagerCallbacks +{ +public: + // Delete copy constructor and assignment operator. + AirPurifierManager(const AirPurifierManager &) = delete; + AirPurifierManager(const AirPurifierManager &&) = delete; + AirPurifierManager & operator=(const AirPurifierManager &) = delete; + + static void InitInstance(EndpointId aEndpointId = 1, EndpointId aAirQualitySensorEndpointId = 2, + EndpointId aTemperatureSensorEndpointId = 3, EndpointId aHumiditySensorEndpointId = 4) + { + if (mInstance == nullptr) + { + mInstance = new AirPurifierManager(aEndpointId, aAirQualitySensorEndpointId, aTemperatureSensorEndpointId, + aHumiditySensorEndpointId); + mInstance->Init(); + } + }; + + /** + * @brief Get an Air Purifier Manager object - this class acts as a singleton device manager for the air purifier + * @param[in] aEndpointId Endpoint that the air purifier is on + * @param[in] aAirQualitySensorEndpointId Endpoint that the air quality sensor is on + * @param[in] aTemperatureSensorEndpointId Endpoint that the temperature sensor is on + * @param[in] aHumiditySensorEndpointId Endpoint that the humidity sensor is on + * @return mInstance The AirPurifierManager instance, note this this could be nullptr if InitInstance has not been called + */ + static AirPurifierManager * GetInstance() { return mInstance; }; + + /** + * @brief Initialize the Air Purifier Manager and call init on underlying composed members. + */ + void Init(); + + /** + * @brief Top level handler for all attribute changes in the device. This function will call the appropriate attribute change + * handler based on the cluster id. + */ + void PostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t type, uint16_t size, + uint8_t * value) override; + + /** + * @brief Handle the step command from the Fan Control Cluster + */ + Protocols::InteractionModel::Status HandleStep(FanControl::StepDirectionEnum aDirection, bool aWrap, bool aLowestOff) override; + +private: + inline static AirPurifierManager * mInstance; + + EndpointId mEndpointId; + EndpointId mAirQualitySensorEndpointId; + EndpointId mTemperatureSensorEndpointId; + EndpointId mHumiditySensorEndpointId; + + uint8_t percentCurrent; + uint8_t speedCurrent; + + // Set up for Activated Carbon Filter Monitoring + ActivatedCarbonFilterMonitoringDelegate activatedCarbonFilterDelegate; + ResourceMonitoring::Instance activatedCarbonFilterInstance; + + // Set up for Hepa Filter Monitoring + HepaFilterMonitoringDelegate hepaFilterDelegate; + ResourceMonitoring::Instance hepaFilterInstance; + + // Set up other members of composed device + AirQualitySensorManager mAirQualitySensorManager; + TemperatureSensorManager mTemperatureSensorManager; + RelativeHumiditySensorManager mHumiditySensorManager; + + // Fan Mode Limits + static constexpr int FAN_MODE_LOW_LOWER_BOUND = 1; + static constexpr int FAN_MODE_LOW_UPPER_BOUND = 3; + static constexpr int FAN_MODE_MEDIUM_LOWER_BOUND = 4; + static constexpr int FAN_MODE_MEDIUM_UPPER_BOUND = 7; + static constexpr int FAN_MODE_HIGH_LOWER_BOUND = 8; + static constexpr int FAN_MODE_HIGH_UPPER_BOUND = 10; + + /** + * @brief Construct a new Air Purifier Manager object - this class acts as a singleton device manager for the air purifier + * @param[in] aEndpointId Endpoint that the air purifier is on + * @param[in] aAirQualitySensorEndpointId Endpoint that the air quality sensor is on + * @param[in] aTemperatureSensorEndpointId Endpoint that the temperature sensor is on + * @param[in] aHumiditySensorEndpointId Endpoint that the humidity sensor is on + */ + AirPurifierManager(EndpointId aEndpointId, EndpointId aAirQualitySensorEndpointId, EndpointId aTemperatureSensorEndpointId, + EndpointId aHumiditySensorEndpointId) : + FanControl::Delegate(aEndpointId), + mEndpointId(aEndpointId), + activatedCarbonFilterInstance(&activatedCarbonFilterDelegate, mEndpointId, ActivatedCarbonFilterMonitoring::Id, + static_cast(gActivatedCarbonFeatureMap.to_ulong()), + ResourceMonitoring::DegradationDirectionEnum::kDown, true), + hepaFilterInstance(&hepaFilterDelegate, mEndpointId, HepaFilterMonitoring::Id, + static_cast(gHepaFilterFeatureMap.to_ulong()), + ResourceMonitoring::DegradationDirectionEnum::kDown, true), + mAirQualitySensorManager(aAirQualitySensorEndpointId), mTemperatureSensorManager(aTemperatureSensorEndpointId), + mHumiditySensorManager(aHumiditySensorEndpointId){}; + + /** + * @brief Handle attribute changes for the Fan Control Cluster + * @param[in] attributeId Cluster attribute id that changed + * @param[in] type Cluster attribute type + * @param[in] size Size of the attribute + * @param[in] value Pointer to the new value + */ + void HandleFanControlAttributeChange(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value); + + void PercentSettingWriteCallback(uint8_t aNewPercentSetting); + void SpeedSettingWriteCallback(uint8_t aNewSpeedSetting); + void FanModeWriteCallback(FanControl::FanModeEnum aNewFanMode); + + void SetSpeedSetting(DataModel::Nullable aNewSpeedSetting); +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/include/air-quality-sensor-manager.h b/examples/air-purifier-app/air-purifier-common/include/air-quality-sensor-manager.h new file mode 100644 index 00000000000000..b5f94d53e2184e --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/air-quality-sensor-manager.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +class AirQualitySensorManager +{ +public: + AirQualitySensorManager(EndpointId aEndpointId) : + mEndpointId(aEndpointId), + airQualityInstance(mEndpointId, + BitMask(AirQuality::Feature::kModerate, AirQuality::Feature::kFair, + AirQuality::Feature::kVeryPoor, + AirQuality::Feature::kExtremelyPoor)), + carbonDioxideConcentrationMeasurementInstance(mEndpointId, CarbonDioxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + carbonMonoxideConcentrationMeasurementInstance(mEndpointId, CarbonMonoxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + nitrogenDioxideConcentrationMeasurementInstance(mEndpointId, NitrogenDioxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + pm1ConcentrationMeasurementInstance(mEndpointId, Pm1ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + pm10ConcentrationMeasurementInstance(mEndpointId, Pm10ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + pm25ConcentrationMeasurementInstance(mEndpointId, Pm25ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + radonConcentrationMeasurementInstance(mEndpointId, RadonConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + totalVolatileOrganicCompoundsConcentrationMeasurementInstance( + mEndpointId, TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + ozoneConcentrationMeasurementInstance(mEndpointId, OzoneConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + formaldehydeConcentrationMeasurementInstance(mEndpointId, FormaldehydeConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm){}; + + void Init(); + +private: + EndpointId mEndpointId; + AirQuality::Instance airQualityInstance; + ConcentrationMeasurement::Instance carbonDioxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance carbonMonoxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance nitrogenDioxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance pm1ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance pm10ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance pm25ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance radonConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance + totalVolatileOrganicCompoundsConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance ozoneConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance formaldehydeConcentrationMeasurementInstance; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/include/filter-delegates.h b/examples/air-purifier-app/air-purifier-common/include/filter-delegates.h new file mode 100644 index 00000000000000..76e131c2e87135 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/filter-delegates.h @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +class ActivatedCarbonFilterMonitoringDelegate : public ResourceMonitoring::Delegate +{ +private: + CHIP_ERROR Init() override; + Protocols::InteractionModel::Status PreResetCondition() override; + Protocols::InteractionModel::Status PostResetCondition() override; + +public: + ~ActivatedCarbonFilterMonitoringDelegate() override = default; +}; + +class HepaFilterMonitoringDelegate : public ResourceMonitoring::Delegate +{ +private: + CHIP_ERROR Init() override; + Protocols::InteractionModel::Status PreResetCondition() override; + Protocols::InteractionModel::Status PostResetCondition() override; + +public: + ~HepaFilterMonitoringDelegate() override = default; +}; + +class ImmutableReplacementProductListManager : public ResourceMonitoring::ReplacementProductListManager +{ +public: + CHIP_ERROR + Next(ResourceMonitoring::ReplacementProductStruct & item) override; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h b/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h new file mode 100644 index 00000000000000..23c82787b0203e --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/relative-humidity-sensor-manager.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RelativeHumiditySensorManager +{ +public: + RelativeHumiditySensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId){}; + + void Init() + { + EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MinMeasuredValue attribute")); + + status = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 10000); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MaxMeasuredValue attribute")); + }; + + void OnHumidityChangeHandler(uint16_t newValue) + { + EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MeasuredValue attribute")); + ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue); + } + +private: + EndpointId mEndpointId; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h b/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h new file mode 100644 index 00000000000000..339d02588f52bc --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/include/temperature-sensor-manager.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { + +class TemperatureSensorManager +{ +public: + TemperatureSensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId){}; + + void Init() + { + EmberAfStatus status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -500); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MinMeasuredValue attribute")); + + status = TemperatureMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 6000); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MaxMeasuredValue attribute")); + } + + void OnTemperatureChangeHandler(int16_t newValue) + { + EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute")); + ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue); + } + +private: + EndpointId mEndpointId; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp b/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp new file mode 100644 index 00000000000000..93e1e37a73dd77 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp @@ -0,0 +1,311 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using Protocols::InteractionModel::Status; + +void AirPurifierManager::Init() +{ + FanControl::SetDefaultDelegate(mEndpointId, this); + + activatedCarbonFilterInstance.Init(); + hepaFilterInstance.Init(); + mAirQualitySensorManager.Init(); + mTemperatureSensorManager.Init(); + mHumiditySensorManager.Init(); + + DataModel::Nullable percentSetting; + EmberAfStatus status = FanControl::Attributes::PercentSetting::Get(mEndpointId, percentSetting); + if (EMBER_ZCL_STATUS_SUCCESS == status) + { + if (percentSetting.IsNull()) + { + PercentSettingWriteCallback(0); + } + else + { + PercentSettingWriteCallback(percentSetting.Value()); + } + } + + DataModel::Nullable speedSetting; + status = FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting); + if (EMBER_ZCL_STATUS_SUCCESS == status) + { + if (speedSetting.IsNull()) + { + SpeedSettingWriteCallback(0); + } + else + { + SpeedSettingWriteCallback(speedSetting.Value()); + } + } + + // Set up some sane initial values for temperature and humidity - note these are fixed values for testing purposes only + mTemperatureSensorManager.OnTemperatureChangeHandler(2000); + mHumiditySensorManager.OnHumidityChangeHandler(5000); +} + +void AirPurifierManager::PostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value) +{ + switch (clusterId) + { + case FanControl::Id: { + HandleFanControlAttributeChange(attributeId, type, size, value); + break; + } + + default: + break; + } +} + +Status AirPurifierManager::HandleStep(FanControl::StepDirectionEnum aDirection, bool aWrap, bool aLowestOff) +{ + ChipLogProgress(NotSpecified, "AirPurifierManager::HandleStep aDirection %d, aWrap %d, aLowestOff %d", + to_underlying(aDirection), aWrap, aLowestOff); + + VerifyOrReturnError(aDirection != FanControl::StepDirectionEnum::kUnknownEnumValue, Status::InvalidCommand); + + uint8_t speedMax; + FanControl::Attributes::SpeedMax::Get(mEndpointId, &speedMax); + + DataModel::Nullable speedSetting; + FanControl::Attributes::SpeedSetting::Get(mEndpointId, speedSetting); + + uint8_t newSpeedSetting = speedSetting.IsNull() ? 0 : speedSetting.Value(); + + if (aDirection == FanControl::StepDirectionEnum::kIncrease) + { + if (speedSetting.IsNull()) + { + newSpeedSetting = 1; + } + else if (speedSetting.Value() < speedMax) + { + newSpeedSetting = static_cast(speedSetting.Value() + 1); + } + else if (speedSetting.Value() == speedMax) + { + if (aWrap) + { + newSpeedSetting = aLowestOff ? 0 : 1; + } + } + } + else if (aDirection == FanControl::StepDirectionEnum::kDecrease) + { + if (speedSetting.IsNull()) + { + newSpeedSetting = aLowestOff ? 0 : 1; + } + else if ((speedSetting.Value() > 1) && (speedSetting.Value() <= speedMax)) + { + newSpeedSetting = static_cast(speedSetting.Value() - 1); + } + else if (speedSetting.Value() == 1) + { + if (aLowestOff) + { + newSpeedSetting = static_cast(speedSetting.Value() - 1); + } + else if (aWrap) + { + newSpeedSetting = speedMax; + } + } + else if (speedSetting.Value() == 0) + { + if (aWrap) + { + newSpeedSetting = speedMax; + } + else if (!aLowestOff) + { + newSpeedSetting = 1; + } + } + } + + return ToInteractionModelStatus(FanControl::Attributes::SpeedSetting::Set(mEndpointId, newSpeedSetting)); +} + +void AirPurifierManager::HandleFanControlAttributeChange(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value) +{ + switch (attributeId) + { + case FanControl::Attributes::PercentSetting::Id: { + DataModel::Nullable percentSetting = static_cast>(*value); + if (percentSetting.IsNull()) + { + PercentSettingWriteCallback(0); + } + else + { + PercentSettingWriteCallback(percentSetting.Value()); + } + break; + } + + case FanControl::Attributes::SpeedSetting::Id: { + DataModel::Nullable speedSetting = static_cast>(*value); + if (speedSetting.IsNull()) + { + SpeedSettingWriteCallback(0); + } + else + { + SpeedSettingWriteCallback(speedSetting.Value()); + } + break; + } + + case FanControl::Attributes::FanMode::Id: { + FanControl::FanModeEnum fanMode = static_cast(*value); + FanModeWriteCallback(fanMode); + break; + } + + default: { + break; + } + } +} + +void AirPurifierManager::PercentSettingWriteCallback(uint8_t aNewPercentSetting) +{ + if (aNewPercentSetting != percentCurrent) + { + ChipLogDetail(NotSpecified, "AirPurifierManager::PercentSettingWriteCallback: %d", aNewPercentSetting); + percentCurrent = aNewPercentSetting; + EmberAfStatus status = FanControl::Attributes::PercentCurrent::Set(mEndpointId, percentCurrent); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, + "AirPurifierManager::PercentSettingWriteCallback: failed to set PercentCurrent attribute: %d", status); + } + } +} + +void AirPurifierManager::SpeedSettingWriteCallback(uint8_t aNewSpeedSetting) +{ + if (aNewSpeedSetting != speedCurrent) + { + ChipLogDetail(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: %d", aNewSpeedSetting); + speedCurrent = aNewSpeedSetting; + EmberAfStatus status = FanControl::Attributes::SpeedCurrent::Set(mEndpointId, speedCurrent); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "AirPurifierManager::SpeedSettingWriteCallback: failed to set SpeedCurrent attribute: %d", + status); + } + + // Determine if the speed change should also change the fan mode + if (speedCurrent == 0) + { + FanControl::Attributes::FanMode::Set(mEndpointId, FanControl::FanModeEnum::kOff); + } + else if (speedCurrent <= FAN_MODE_LOW_UPPER_BOUND) + { + FanControl::Attributes::FanMode::Set(mEndpointId, FanControl::FanModeEnum::kLow); + } + else if (speedCurrent <= FAN_MODE_MEDIUM_UPPER_BOUND) + { + FanControl::Attributes::FanMode::Set(mEndpointId, FanControl::FanModeEnum::kMedium); + } + else if (speedCurrent <= FAN_MODE_HIGH_UPPER_BOUND) + { + FanControl::Attributes::FanMode::Set(mEndpointId, FanControl::FanModeEnum::kHigh); + } + } +} + +void AirPurifierManager::FanModeWriteCallback(FanControl::FanModeEnum aNewFanMode) +{ + ChipLogDetail(NotSpecified, "AirPurifierManager::FanModeWriteCallback: %d", (uint8_t) aNewFanMode); + switch (aNewFanMode) + { + case FanControl::FanModeEnum::kOff: { + if (speedCurrent != 0) + { + DataModel::Nullable speedSetting(0); + SetSpeedSetting(speedSetting); + } + break; + } + case FanControl::FanModeEnum::kLow: { + if (speedCurrent < FAN_MODE_LOW_LOWER_BOUND || speedCurrent > FAN_MODE_LOW_UPPER_BOUND) + { + DataModel::Nullable speedSetting(FAN_MODE_LOW_LOWER_BOUND); + SetSpeedSetting(speedSetting); + } + break; + } + case FanControl::FanModeEnum::kMedium: { + if (speedCurrent < FAN_MODE_MEDIUM_LOWER_BOUND || speedCurrent > FAN_MODE_MEDIUM_UPPER_BOUND) + { + DataModel::Nullable speedSetting(FAN_MODE_MEDIUM_LOWER_BOUND); + SetSpeedSetting(speedSetting); + } + break; + } + case FanControl::FanModeEnum::kOn: + case FanControl::FanModeEnum::kHigh: { + if (speedCurrent < FAN_MODE_HIGH_LOWER_BOUND || speedCurrent > FAN_MODE_HIGH_UPPER_BOUND) + { + DataModel::Nullable speedSetting(FAN_MODE_HIGH_LOWER_BOUND); + SetSpeedSetting(speedSetting); + } + break; + } + case FanControl::FanModeEnum::kSmart: + case FanControl::FanModeEnum::kAuto: { + ChipLogProgress(NotSpecified, "AirPurifierManager::FanModeWriteCallback: Auto"); + break; + } + case FanControl::FanModeEnum::kUnknownEnumValue: { + ChipLogProgress(NotSpecified, "AirPurifierManager::FanModeWriteCallback: Unknown"); + break; + } + } +} + +void AirPurifierManager::SetSpeedSetting(DataModel::Nullable aNewSpeedSetting) +{ + if (aNewSpeedSetting.IsNull()) + { + ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: invalid value"); + return; + } + + if (aNewSpeedSetting.Value() != speedCurrent) + { + EmberAfStatus status = FanControl::Attributes::SpeedSetting::Set(mEndpointId, aNewSpeedSetting); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "AirPurifierManager::SetSpeedSetting: failed to set SpeedSetting attribute: %d", status); + } + } +} diff --git a/examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp b/examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp new file mode 100644 index 00000000000000..d6c3155c2501e4 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp @@ -0,0 +1,158 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ConcentrationMeasurement; +using namespace chip::app::Clusters::AirQuality; + +void AirQualitySensorManager::Init() +{ + /* + * Note these values are for testing purposes only and are not actual values for the air quality sensor. + * They are also fixed. + */ + + // Air Quality + airQualityInstance.Init(); + airQualityInstance.UpdateAirQuality(AirQualityEnum::kGood); + + // CO2 + carbonDioxideConcentrationMeasurementInstance.Init(); + carbonDioxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + carbonDioxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + carbonDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + carbonDioxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + carbonDioxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + carbonDioxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + carbonDioxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + carbonDioxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + carbonDioxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // CO + carbonMonoxideConcentrationMeasurementInstance.Init(); + carbonMonoxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + carbonMonoxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + carbonMonoxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + carbonMonoxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + carbonMonoxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + carbonMonoxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + carbonMonoxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + carbonMonoxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + carbonMonoxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // NO2 + nitrogenDioxideConcentrationMeasurementInstance.Init(); + nitrogenDioxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + nitrogenDioxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + nitrogenDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + nitrogenDioxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + nitrogenDioxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + nitrogenDioxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + nitrogenDioxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + nitrogenDioxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + nitrogenDioxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM1 + pm1ConcentrationMeasurementInstance.Init(); + pm1ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + pm1ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + pm1ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + pm1ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + pm1ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + pm1ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + pm1ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + pm1ConcentrationMeasurementInstance.SetUncertainty(0.0f); + pm1ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM10 + pm10ConcentrationMeasurementInstance.Init(); + pm10ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + pm10ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + pm10ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + pm10ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + pm10ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + pm10ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + pm10ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + pm10ConcentrationMeasurementInstance.SetUncertainty(0.0f); + pm10ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM2.5 + pm25ConcentrationMeasurementInstance.Init(); + pm25ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + pm25ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + pm25ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + pm25ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + pm25ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + pm25ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + pm25ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + pm25ConcentrationMeasurementInstance.SetUncertainty(0.0f); + pm25ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Radon + radonConcentrationMeasurementInstance.Init(); + radonConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + radonConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + radonConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + radonConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + radonConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + radonConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + radonConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + radonConcentrationMeasurementInstance.SetUncertainty(0.0f); + radonConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // TVOC + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.Init(); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetUncertainty(0.0f); + totalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Ozone + ozoneConcentrationMeasurementInstance.Init(); + ozoneConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + ozoneConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + ozoneConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + ozoneConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + ozoneConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + ozoneConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + ozoneConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + ozoneConcentrationMeasurementInstance.SetUncertainty(0.0f); + ozoneConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Formaldehyde + formaldehydeConcentrationMeasurementInstance.Init(); + formaldehydeConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + formaldehydeConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + formaldehydeConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + formaldehydeConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + formaldehydeConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + formaldehydeConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + formaldehydeConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + formaldehydeConcentrationMeasurementInstance.SetUncertainty(0.0f); + formaldehydeConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); +} diff --git a/examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp b/examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp new file mode 100644 index 00000000000000..74091ab778b539 --- /dev/null +++ b/examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp @@ -0,0 +1,108 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ResourceMonitoring; +using namespace chip::app::Clusters::ActivatedCarbonFilterMonitoring; +using namespace chip::app::Clusters::HepaFilterMonitoring; +using chip::Protocols::InteractionModel::Status; + +static ImmutableReplacementProductListManager sReplacementProductListManager; + +//-- Activated Carbon Filter Monitoring delegate methods +CHIP_ERROR ActivatedCarbonFilterMonitoringDelegate::Init() +{ + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::Init()"); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); + return CHIP_NO_ERROR; +} + +Status ActivatedCarbonFilterMonitoringDelegate::PreResetCondition() +{ + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PreResetCondition()"); + return Status::Success; +} + +Status ActivatedCarbonFilterMonitoringDelegate::PostResetCondition() +{ + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PostResetCondition()"); + return Status::Success; +} + +//-- Hepa Filter Monitoring delegate methods +CHIP_ERROR HepaFilterMonitoringDelegate::Init() +{ + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::Init()"); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); + return CHIP_NO_ERROR; +} + +Status HepaFilterMonitoringDelegate::PreResetCondition() +{ + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PreResetCondition()"); + return Status::Success; +} + +Status HepaFilterMonitoringDelegate::PostResetCondition() +{ + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PostResetCondition()"); + return Status::Success; +} + +CHIP_ERROR ImmutableReplacementProductListManager::Next(ReplacementProductStruct & item) +{ + if (mIndex >= kReplacementProductListMaxSize) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + switch (mIndex) + { + case 0: { + item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kUpc); + item.SetProductIdentifierValue(CharSpan::fromCharString("111112222233")); + break; + case 1: + item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin8); + item.SetProductIdentifierValue(CharSpan::fromCharString("gtin8xxx")); + break; + case 2: + item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kEan); + item.SetProductIdentifierValue(CharSpan::fromCharString("4444455555666")); + break; + case 3: + item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin14); + item.SetProductIdentifierValue(CharSpan::fromCharString("gtin14xxxxxxxx")); + break; + case 4: + item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kOem); + item.SetProductIdentifierValue(CharSpan::fromCharString("oem20xxxxxxxxxxxxxxx")); + break; + default: + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + break; + } + } + mIndex++; + return CHIP_NO_ERROR; +} diff --git a/examples/air-purifier-app/ameba/.gitignore b/examples/air-purifier-app/ameba/.gitignore new file mode 100644 index 00000000000000..234526a082ad26 --- /dev/null +++ b/examples/air-purifier-app/ameba/.gitignore @@ -0,0 +1,5 @@ +*.vscode + +/build/ +/sdkconfig +/sdkconfig.old diff --git a/examples/air-purifier-app/ameba/README.md b/examples/air-purifier-app/ameba/README.md new file mode 100644 index 00000000000000..be11ad8d063210 --- /dev/null +++ b/examples/air-purifier-app/ameba/README.md @@ -0,0 +1,117 @@ +# CHIP Ameba Air Purifier Example + +This example demonstrates the Matter air purifier application on Ameba platform. + +--- + +- [CHIP Ameba Air Purifier Example](#chip-ameba-air-purifier-example) + - [Supported Device](#supported-device) + - [Building the Example Application](#building-the-example-application) + - [Commissioning](#commissioning) + - [BLE mode](#ble-mode) + - [IP mode](#ip-mode) + - [Cluster control](#cluster-control) + +--- + +## Supported Device + +The CHIP demo application is supported on +[Ameba RTL8722DM Board](https://www.amebaiot.com/en/amebad). + +## Building the Example Application + +- Check out the Ameba repository in the same folder/directory as the Matter + SDK repository: + +``` +git clone https://github.com/ambiot/ambd_matter.git +``` + +- Setup build environment: + +``` +$ cd connectedhomeip +$ source scripts/bootstrap.sh +``` + +- To build the demo application: + +``` +$ cd ambd_matter/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/ +$ make all + +$ cd ambd_matter/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/ +$ make -C asdk air_purifier + +From the same directory: +$ make all +``` + +- Combine the three output images for flashing using the **Ameba Image Tool**: + +``` +$ cd ambd_matter/tools/AmebaD/Image_Tool_Linux + +$ sudo ./AmebaD_ImageTool -combine \ + ../../../project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/image/km0_boot_all.bin 0x0000 \ + ../../../project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km4_boot_all.bin 0x4000 \ + ../../../project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/image/km0_km4_image2.bin 0x6000 +``` + +- This will produce a combined Image_All.bin file alongside the image tool + that can be flashed using the **Ameba Image Tool**: + +1. Connect your device via USB +2. Edit the `ambd_matter/tools/AmebaD/mpp.ini` file with the correct port + setting (the rest of the settings should be correct) +3. Click **Download** button and the **Reset** button to get the board into + serial download mode +4. Flash on the image: + +``` +$ cd ambd_matter/tools/AmebaD/Image_Tool_Linux +$ ./AmebaD_ImageTool -download +``` + +## Commissioning + +There are two commissioning modes supported by Ameba platform: + +### BLE mode + +1. Build and Flash +2. The example will run automatically after booting the Ameba board. +3. Test with + [Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool) + +### IP mode + +1. Build and Flash +2. The example will run automatically after booting the Ameba board. +3. Connect to AP using `ATW0, ATW1, ATWC` commands +4. Test with + [Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool) + +## Cluster Control + +After successful commissioning, the air purifier clusters can be read and +controlled using +[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool#using-the-client-to-send-matter-commands). + +The Air Purifier is a composed device. The example has endpoints configured as +follows: + +- Air purifier on endpoint 1 +- Air quality sensor on endpoint 2 +- Temperature sensor on endpoint 3 +- Relative humidity sensor on endpoint 4 + +Example commands using the chip tool: + +``` +$ ./chip-tool fancontrol write speed-setting 10 ${NODE_ID_TO_ASSIGN} 1 +$ ./chip-tool formaldehydeconcentrationmeasurement read level-value ${NODE_ID_TO_ASSIGN} 2 +$ ./chip-tool temperaturemeasurement read measured-value ${NODE_ID_TO_ASSIGN} 3 +$ ./chip-tool relativehumiditymeasurement read measured-value ${NODE_ID_TO_ASSIGN} 4 +``` diff --git a/examples/air-purifier-app/ameba/chip_main.cmake b/examples/air-purifier-app/ameba/chip_main.cmake new file mode 100755 index 00000000000000..df900f2508de17 --- /dev/null +++ b/examples/air-purifier-app/ameba/chip_main.cmake @@ -0,0 +1,284 @@ +cmake_minimum_required(VERSION 3.6) + +project(chip_main) + +set(chip_dir "${ameba_matter_root}") +set(chip_dir_output "${matter_output_path}/chip") +set(dir "${sdk_root}/component/common/api") +set(chip_main chip_main) +set(list_chip_main_sources chip_main_sources) + +if (matter_enable_rpc) +set(pigweed_dir "${chip_dir}/third_party/pigweed/repo") + +include(${pigweed_dir}/pw_build/pigweed.cmake) +include(${pigweed_dir}/pw_protobuf_compiler/proto.cmake) +include(${pigweed_dir}/pw_assert/backend.cmake) +include(${pigweed_dir}/pw_log/backend.cmake) +include(${pigweed_dir}/pw_sys_io/backend.cmake) +include(${pigweed_dir}/pw_trace/backend.cmake) + +set(dir_pw_third_party_nanopb "${chip_dir}/third_party/nanopb/repo" CACHE STRING "" FORCE) + +pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) +pw_set_backend(pw_log pw_log_basic) +pw_set_backend(pw_assert.check pw_assert_log.check_backend) +pw_set_backend(pw_assert.assert pw_assert.assert_compatibility_backend) +pw_set_backend(pw_sys_io pw_sys_io.ameba) +pw_set_backend(pw_trace pw_trace_tokenized) + +add_subdirectory(${chip_dir}/third_party/pigweed/repo ${chip_dir}/examples/air-purifier-app/ameba/out/pigweed) +add_subdirectory(${chip_dir}/third_party/nanopb/repo ${chip_dir}/examples/air-purifier-app/ameba/out/nanopb) +add_subdirectory(${chip_dir}/examples/platform/ameba/pw_sys_io ${chip_dir}/examples/air-purifier-app/ameba/out/pw_sys_io) + +pw_proto_library(attributes_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/attributes_service.proto + INPUTS + ${chip_dir}/examples/common/pigweed/protos/attributes_service.options + PREFIX + attributes_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(button_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/button_service.proto + PREFIX + button_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(descriptor_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/descriptor_service.proto + PREFIX + descriptor_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(device_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/device_service.proto + INPUTS + ${chip_dir}/examples/common/pigweed/protos/device_service.options + PREFIX + device_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(lighting_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/lighting_service.proto + PREFIX + lighting_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(locking_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/locking_service.proto + PREFIX + locking_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_proto +) + +pw_proto_library(wifi_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/wifi_service.proto + INPUTS + ${chip_dir}/examples/common/pigweed/protos/wifi_service.options + PREFIX + wifi_service + DEPS + pw_protobuf.common_proto + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos +) + +endif(matter_enable_rpc) + +include(${prj_root}/GCC-RELEASE/project_hp/asdk/includepath.cmake) + +if (matter_enable_rpc) +list( + APPEND ${list_chip_main_sources} + #rpc + ${chip_dir}/examples/platform/ameba/PigweedLogger.cpp + ${chip_dir}/examples/platform/ameba/Rpc.cpp + ${chip_dir}/examples/common/pigweed/RpcService.cpp + ${chip_dir}/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp +) +endif (matter_enable_rpc) + +if (matter_enable_ota_requestor) +list( + APPEND ${list_chip_main_sources} + #OTARequestor + ${chip_dir}/src/app/clusters/ota-requestor/BDXDownloader.cpp + ${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp + ${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp + ${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp + ${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp + ${chip_dir}/examples/platform/ameba/ota/OTAInitializer.cpp +) +endif (matter_enable_ota_requestor) + +list( + APPEND ${list_chip_main_sources} + + ${chip_dir}/examples/air-purifier-app/ameba/main/chipinterface.cpp + ${chip_dir}/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp + ${chip_dir}/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp + + ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_hook.c + ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_table.c + + ${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp +) + +add_library( + ${chip_main} + STATIC + ${chip_main_sources} +) + +chip_configure_data_model(chip_main + INCLUDE_SERVER + ZAP_FILE ${matter_example_path}/../air-purifier-common/air-purifier-app.zap +) + +if (matter_enable_rpc) +target_include_directories( + ${chip_main} + PUBLIC + #rpc + ${chip_dir}/examples/platform/ameba + ${chip_dir}/examples/platform/ameba/pw_sys_io/public + ${chip_dir}/examples/common + ${chip_dir}/examples/common/pigweed + ${chip_dir}/examples/common/pigweed/ameba + ${chip_dir}/src + ${chip_dir}/src/lib/support + ${pigweed_dir}/pw_rpc/nanopb/public +) +endif (matter_enable_rpc) + +target_include_directories( + ${chip_main} + PUBLIC + ${inc_path} + ${chip_dir}/zzz_generated/air-purifier-app + ${chip_dir}/zzz_generated/air-purifier-app/zap-generated + ${chip_dir}/zzz_generated/app-common + ${chip_dir}/examples/air-purifier-app/air-purifier-common + ${chip_dir}/examples/air-purifier-app/air-purifier-common/include + ${chip_dir}/examples/air-purifier-app/ameba/main/include + ${chip_dir}/examples/platform/ameba + ${chip_dir}/examples/providers + ${chip_dir_output}/gen/include + ${chip_dir}/src/include/ + ${chip_dir}/src/lib/ + ${chip_dir}/src/ + ${chip_dir}/third_party/nlassert/repo/include/ + ${chip_dir}/src/app/ + ${chip_dir}/src/app/util/ + ${chip_dir}/src/app/server/ + ${chip_dir}/src/controller/data_model + ${chip_dir}/third_party/nlio/repo/include/ + ${chip_dir}/third_party/nlunit-test/repo/src +) + +if (matter_enable_rpc) +target_link_libraries(${chip_main} PUBLIC + attributes_service.nanopb_rpc + button_service.nanopb_rpc + descriptor_service.nanopb_rpc + device_service.nanopb_rpc + lighting_service.nanopb_rpc + locking_service.nanopb_rpc + wifi_service.nanopb_rpc + pw_checksum + pw_hdlc + pw_log + pw_rpc.server + pw_sys_io + pw_trace_tokenized + pw_trace_tokenized.trace_buffer + pw_trace_tokenized.rpc_service + pw_trace_tokenized.protos.nanopb_rpc + PwRpc +) + +link_directories( + ${chip_dir_output}/lib +) +endif (matter_enable_rpc) + +list( + APPEND chip_main_flags + + -DINET_CONFIG_ENABLE_IPV4=0 + -DCHIP_PROJECT=1 + -DCHIP_DEVICE_LAYER_TARGET=Ameba + -DUSE_ZAP_CONFIG + -DCHIP_HAVE_CONFIG_H + -DMBEDTLS_CONFIG_FILE= +) + +if (matter_enable_persistentstorage_audit) +list( + APPEND chip_main_flags + + -DCHIP_SUPPORT_ENABLE_STORAGE_API_AUDIT +) +endif (matter_enable_persistentstorage_audit) + +if (matter_enable_rpc) +list( + APPEND chip_main_flags + + -DPW_RPC_ATTRIBUTE_SERVICE=1 + -DPW_RPC_BUTTON_SERVICE=1 + -DPW_RPC_DESCRIPTOR_SERVICE=1 + -DPW_RPC_DEVICE_SERVICE=1 + -DPW_RPC_LIGHTING_SERVICE=1 + -DPW_RPC_LOCKING_SERVICE=1 + -DCONFIG_ENABLE_PW_RPC=1 +) +endif (matter_enable_rpc) + +list( + APPEND chip_main_cpp_flags + + -Wno-unused-parameter + -std=c++17 + -fno-rtti +) +target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} ) +target_compile_options(${chip_main} PRIVATE ${chip_main_cpp_flags}) + +# move static library post build command +add_custom_command( + TARGET ${chip_main} + POST_BUILD + COMMAND cp lib${chip_main}.a ${CMAKE_CURRENT_SOURCE_DIR}/lib/application +) diff --git a/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp b/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp new file mode 100644 index 00000000000000..0c73b5506f0849 --- /dev/null +++ b/examples/air-purifier-app/ameba/main/CHIPDeviceManager.cpp @@ -0,0 +1,112 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the CHIP Device Interface that is used by + * applications to interact with the CHIP stack + * + */ + +#include + +#include "CHIPDeviceManager.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::Clusters; +using namespace ::chip::Credentials; + +namespace chip { + +namespace DeviceManager { + +using namespace ::chip::DeviceLayer; + +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + +void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); + if (cb != nullptr) + { + cb->DeviceEventCallback(event, reinterpret_cast(cb)); + } +} + +CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) +{ + CHIP_ERROR err; + mCB = cb; + + err = Platform::MemoryInit(); + SuccessOrExit(err); + + err = PlatformMgr().InitChipStack(); + SuccessOrExit(err); + + err = mFactoryDataProvider.Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error initializing FactoryData!"); + ChipLogError(DeviceLayer, "Check if you have flashed it correctly!"); + } + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + + if (CONFIG_NETWORK_LAYER_BLE) + { + ConnectivityMgr().SetBLEAdvertisingEnabled(true); + } + + PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); + + // // Start a task to run the CHIP Device event loop. + err = PlatformMgr().StartEventLoopTask(); + SuccessOrExit(err); + +exit: + return err; +} +} // namespace DeviceManager +} // namespace chip + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + if (AirPurifierManager::GetInstance() != nullptr) + { + AirPurifierManager::GetInstance()->PostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, + attributePath.mAttributeId, type, size, value); + } +} diff --git a/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp b/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..0a5d9dd2617ce1 --- /dev/null +++ b/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" + +#include "CHIPDeviceManager.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +#include +#endif + +static const char * TAG = "app-devicecallbacks"; + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceManager; +using namespace ::chip::Logging; + +uint32_t identifyTimerCount; +constexpr uint32_t kIdentifyTimerDelayMS = 250; +constexpr uint32_t kInitOTARequestorDelaySec = 3; + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +void InitOTARequestorHandler(System::Layer * systemLayer, void * appState) +{ + OTAInitializer::Instance().InitOTARequestor(); +} +#endif + +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kInternetConnectivityChange: + OnInternetConnectivityChange(event); + break; + + case DeviceEventType::kCHIPoBLEConnectionEstablished: + ChipLogProgress(DeviceLayer, "CHIPoBLE Connection Established"); + break; + + case DeviceEventType::kCHIPoBLEConnectionClosed: + ChipLogProgress(DeviceLayer, "CHIPoBLE Connection Closed"); + break; + + case DeviceEventType::kCHIPoBLEAdvertisingChange: + ChipLogProgress(DeviceLayer, "CHIPoBLE advertising has changed"); + break; + + case DeviceEventType::kInterfaceIpAddressChanged: + if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || + (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) + { + // MDNS server restart on any ip assignment: if link local ipv6 is configured, that + // will not trigger a 'internet connectivity change' as there is no internet + // connectivity. MDNS still wants to refresh its listening interfaces to include the + // newly selected address. + chip::app::DnssdServer::Instance().StartServer(); + } + if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned) + { + ChipLogProgress(DeviceLayer, "Initializing route hook..."); + ameba_route_hook_init(); + } + break; + + case DeviceEventType::kCommissioningComplete: + ChipLogProgress(DeviceLayer, "Commissioning Complete"); + chip::DeviceLayer::Internal::AmebaUtils::SetCurrentProvisionedNetwork(); + break; + } +} + +void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) +{ + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) + { + printf("IPv4 Server ready..."); + chip::app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost) + { + printf("Lost IPv4 connectivity..."); + } + if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established) + { + printf("IPv6 Server ready..."); + chip::app::DnssdServer::Instance().StartServer(); +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + // Init OTA requestor only when we have gotten IPv6 address + if (!OTAInitializer::Instance().CheckInit()) + { + ChipLogProgress(DeviceLayer, "Initializing OTA"); + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec), + InitOTARequestorHandler, nullptr); + } +#endif + } + else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) + { + printf("Lost IPv6 connectivity..."); + } +} + +void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t type, + uint16_t size, uint8_t * value) +{ + switch (clusterId) + { + case app::Clusters::Identify::Id: + OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); + break; + + default: + ChipLogProgress(Zcl, "Unknown cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + break; + } +} + +void IdentifyTimerHandler(Layer * systemLayer, void * appState) +{ + if (identifyTimerCount) + { + systemLayer->StartTimer(Clock::Milliseconds32(kIdentifyTimerDelayMS), IdentifyTimerHandler, appState); + // Decrement the timer count. + identifyTimerCount--; + } +} + +void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + VerifyOrExit(attributeId == app::Clusters::Identify::Attributes::IdentifyTime::Id, + ChipLogError(DeviceLayer, "[%s] Unhandled Attribute ID: '0x%04x", TAG, attributeId)); + VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "[%s] Unexpected EndPoint ID: `0x%02x'", TAG, endpointId)); + + // timerCount represents the number of callback executions before we stop the timer. + // value is expressed in seconds and the timer is fired every 250ms, so just multiply value by 4. + // Also, we want timerCount to be odd number, so the ligth state ends in the same state it starts. + identifyTimerCount = (*value) * 4; + + DeviceLayer::SystemLayer().CancelTimer(IdentifyTimerHandler, this); + DeviceLayer::SystemLayer().StartTimer(Clock::Milliseconds32(kIdentifyTimerDelayMS), IdentifyTimerHandler, this); + +exit: + return; +} diff --git a/examples/air-purifier-app/ameba/main/chipinterface.cpp b/examples/air-purifier-app/ameba/main/chipinterface.cpp new file mode 100644 index 00000000000000..bcda329cdb8536 --- /dev/null +++ b/examples/air-purifier-app/ameba/main/chipinterface.cpp @@ -0,0 +1,175 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "CHIPDeviceManager.h" +#include "DeviceCallbacks.h" +#include "Server.h" +#include + +#include "chip_porting.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#if CONFIG_ENABLE_PW_RPC +#include "Rpc.h" +#endif + +#define AIR_PURIFIER_ENDPOINT 1 +#define AIR_QUALITY_SENSOR_ENDPOINT 2 +#define TEMPERATURE_SENSOR_ENDPOINT 3 +#define RELATIVE_HUMIDITY_SENSOR_ENDPOINT 4 + +using namespace ::chip; +using namespace ::chip::app; +using namespace ::chip::DeviceManager; +using namespace ::chip::DeviceLayer; +using namespace ::chip::System; + +namespace { // Network Commissioning +constexpr EndpointId kNetworkCommissioningEndpointMain = 0; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; + +app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointMain /* Endpoint Id */, + &(NetworkCommissioning::AmebaWiFiDriver::GetInstance())); +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); + + // We only have network commissioning on endpoint 0. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); +} + +static DeviceCallbacks EchoCallbacks; +chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; + +void OnIdentifyStart(Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStart"); +} + +void OnIdentifyStop(Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStop"); +} + +void OnTriggerEffect(Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case Clusters::Identify::EffectIdentifierEnum::kBlink: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBlink"); + break; + case Clusters::Identify::EffectIdentifierEnum::kBreathe: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kBreathe"); + break; + case Clusters::Identify::EffectIdentifierEnum::kOkay: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kOkay"); + break; + case Clusters::Identify::EffectIdentifierEnum::kChannelChange: + ChipLogProgress(Zcl, "Clusters::Identify::EffectIdentifierEnum::kChannelChange"); + break; + default: + ChipLogProgress(Zcl, "No identifier effect"); + return; + } +} + +static Identify gIdentify1 = { + chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, + OnTriggerEffect, +}; + +static void InitAirPurifierManager(void) +{ + Clusters::AirPurifierManager::InitInstance(EndpointId(AIR_PURIFIER_ENDPOINT), EndpointId(AIR_QUALITY_SENSOR_ENDPOINT), + EndpointId(TEMPERATURE_SENSOR_ENDPOINT), + EndpointId(RELATIVE_HUMIDITY_SENSOR_ENDPOINT)); + + SetParentEndpointForEndpoint(AIR_QUALITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(TEMPERATURE_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(RELATIVE_HUMIDITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); +} + +static void InitServer(intptr_t context) +{ + // Init ZCL Data Model and CHIP App Server + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + chip::Server::GetInstance().Init(initParams); + gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage()); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + + NetWorkCommissioningInstInit(); + + if (RTW_SUCCESS != wifi_is_connected_to_ap()) + { + // QR code will be used with CHIP Tool + PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); + } + + InitAirPurifierManager(); +} + +extern "C" void ChipTest(void) +{ + ChipLogProgress(DeviceLayer, "Air purifier App Demo!"); + CHIP_ERROR err = CHIP_NO_ERROR; + +#if CONFIG_ENABLE_PW_RPC + chip::rpc::Init(); +#endif + + initPref(); + + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + + err = deviceMgr.Init(&EchoCallbacks); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "DeviceManagerInit() - ERROR!\r\n"); + } + else + { + ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n"); + } + + chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0); +} + +bool lowPowerClusterSleep() +{ + return true; +} diff --git a/examples/air-purifier-app/ameba/main/include/CHIPDeviceManager.h b/examples/air-purifier-app/ameba/main/include/CHIPDeviceManager.h new file mode 100644 index 00000000000000..1a8ac985132365 --- /dev/null +++ b/examples/air-purifier-app/ameba/main/include/CHIPDeviceManager.h @@ -0,0 +1,123 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains definitions for the CHIP DeviceManager Interface + * + * This object will co-ordinate multiple activities such as + * initialisation, rendezvous, session mgmt and other such + * activities within the CHIP stack. This is a singleton object. + */ + +#pragma once + +#include +#include +#include + +#include + +#include +#include + +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class CHIPDeviceManagerCallbacks +{ +public: + /** + * @brief + * Called when CHIP Device events (PublicEventTypes) are triggered. + * + * @param event ChipDeviceEvent that occurred + * @param arg arguments specific to the event, if any + */ + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) {} + + /** + * @brief + * Called after an attribute has been changed + * + * @param endpoint endpoint id + * @param clusterID cluster id + * @param attributeId attribute id that was changed + * @param manufacturerCode manufacturer code + * @param type attribute type + * @param size size of the attribute + * @param value pointer to the new value + */ + virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value) + {} + virtual ~CHIPDeviceManagerCallbacks() {} +}; + +/** + * @brief + * A common class that drives other components of the CHIP stack + */ +class DLL_EXPORT CHIPDeviceManager +{ +public: + CHIPDeviceManager(const CHIPDeviceManager &) = delete; + CHIPDeviceManager(const CHIPDeviceManager &&) = delete; + CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete; + + static CHIPDeviceManager & GetInstance() + { + static CHIPDeviceManager instance; + return instance; + } + + /** + * @brief + * Initialise CHIPDeviceManager + * + * @param cb Application's instance of the CHIPDeviceManagerCallbacks for consuming events + */ + CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + + /** + * @brief + * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. + * + */ + CHIPDeviceManagerCallbacks * GetCHIPDeviceManagerCallbacks() { return mCB; } + + /** + * Use internally for registration of the ChipDeviceEvents + */ + static void CommonDeviceEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + +private: + CHIPDeviceManagerCallbacks * mCB = nullptr; + CHIPDeviceManager() {} +}; + +} // namespace DeviceManager +} // namespace chip diff --git a/examples/air-purifier-app/ameba/main/include/CHIPProjectAppConfig.h b/examples/air-purifier-app/ameba/main/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..e3a2e726e2db2a --- /dev/null +++ b/examples/air-purifier-app/ameba/main/include/CHIPProjectAppConfig.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x002D // Air Purifier + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 + +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Air Purifier" diff --git a/examples/air-purifier-app/ameba/main/include/DeviceCallbacks.h b/examples/air-purifier-app/ameba/main/include/DeviceCallbacks.h new file mode 100755 index 00000000000000..696fbd1c2b95c4 --- /dev/null +++ b/examples/air-purifier-app/ameba/main/include/DeviceCallbacks.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#pragma once + +#include "CHIPDeviceManager.h" +#include +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value) override; + +private: + void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +}; diff --git a/examples/air-purifier-app/ameba/third_party/connectedhomeip b/examples/air-purifier-app/ameba/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/air-purifier-app/ameba/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/air-purifier-app/cc32xx/.gn b/examples/air-purifier-app/cc32xx/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/air-purifier-app/cc32xx/.gn @@ -0,0 +1,28 @@ +# 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_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/air-purifier-app/cc32xx/BUILD.gn b/examples/air-purifier-app/cc32xx/BUILD.gn new file mode 100755 index 00000000000000..51916cc32d646f --- /dev/null +++ b/examples/air-purifier-app/cc32xx/BUILD.gn @@ -0,0 +1,126 @@ +# 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") +import("//build_overrides/chip.gni") +import("//build_overrides/ti_simplelink_sdk.gni") +import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") +import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") +import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") + +assert(current_os == "freertos") + +project_dir = "${chip_root}/examples/air-purifier-app/cc32xx" + +ti_simplelink_sdk("sdk") { + include_dirs = [ "${project_dir}/main/include" ] + + defines = [] + if (is_debug) { + defines += [ "BUILD_RELEASE=0" ] + } else { + defines += [ "BUILD_RELEASE=1" ] + } +} + +ti_sysconfig("sysconfig") { + sources = [ "${project_dir}/chip.syscfg" ] + outputs = [ + "ti_drivers_net_wifi_config.c", + "ti_net_config.c", + "ti_drivers_config.c", + "ti_drivers_config.h", + ] +} + +source_set("air-purifier_app_sdk") { + defines = [] + + configs -= [ "${build_root}/config/compiler:std_default" ] + configs += [ ":sdk_posix_config" ] + + sources = [ + "${chip_root}/src/platform/cc32xx/Logging.cpp", + "${project_dir}/main/cc32xxWifiInit.c", + "${project_dir}/main/main.cpp", + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/lwip_if.c", + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/utils_if.c", + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/wifi_if.c", + ] + + include_dirs = [ + "${project_dir}/include", + "${project_dir}/main", + "${project_dir}/main/ifmod/", + "${chip_root}/src/platform/cc32xx", + "${chip_root}/examples/platform/cc32xx", + ] + + deps = [ + ":sdk", + ":sysconfig", + "${chip_root}/examples/air-purifier-app/air-purifier-common", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] +} + +ti_simplelink_executable("air-purifier_app") { + defines = [] + output_name = "chip-${ti_simplelink_board}-air-purifier-example.out" + + sources = [ + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp", + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp", + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp", + "${project_dir}/main/AppTask.cpp", + "${project_dir}/main/CHIPDeviceManager.cpp", + "${project_dir}/main/CXXExceptionStubs.cpp", + "${project_dir}/main/DeviceCallbacks.cpp", + "${project_dir}/main/ZclCallbacks.cpp", + ] + + deps = [ + ":air-purifier_app_sdk", + ":sdk", + ":sysconfig", + "${chip_root}/examples/air-purifier-app/air-purifier-common", + "${chip_root}/examples/platform/cc32xx:cc32xx-attestation-credentials", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] + + include_dirs = [ + "${project_dir}", + "${project_dir}/main", + "${chip_root}/examples/air-purifier-app/air-purifier-common/include", + ] + + cflags = [ + "-Wno-implicit-fallthrough", + "-Wno-sign-compare", + "-Wconversion", + ] + + output_dir = root_out_dir +} + +group("cc32xx") { + deps = [ ":air-purifier_app" ] +} + +group("default") { + deps = [ ":cc32xx" ] +} diff --git a/examples/air-purifier-app/cc32xx/README.md b/examples/air-purifier-app/cc32xx/README.md new file mode 100644 index 00000000000000..529c3c245be9ca --- /dev/null +++ b/examples/air-purifier-app/cc32xx/README.md @@ -0,0 +1,163 @@ +# Matter `CC32XXSF` Air Purifier Example Application + +An example application showing the use of [Matter][matter] on the Texas +Instruments CC32XX family of Wireless MCUs. + +--- + +- [Matter `CC32XXSF` Air Purifier Example Application](#matter-cc32xxsf-air-purifier-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Preparation](#preparation) + - [Compilation](#compilation) + - [Adding DAC Certificates](#adding-dac-certificates) + - [Programming](#programming) + - [Code Composer Studio](#code-composer-studio) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Example](#running-the-example) + - [Provisioning](#provisioning) + - [Bluetooth LE Provisioning](#bluetooth-le-provisioning) + +--- + +## Introduction + +The CC32XX air purifier example application provides a working demonstration of +a connected air purifier device. This uses the open-source CHIP implementation +and the Texas Instruments SimpleLink™ Wi-Fi® CC32xx software development kit. + +By default this example targets the [CC3235SF_LAUNCHXL][cc3235sf_launchxl] +LaunchPad, but the example application is enabled to build on the whole `CC32XX` +family of MCUs. + +The air purifier example is intended to serve both as a means to explore the +workings of CHIP, as well as a template for creating real products based on the +Texas Instruments devices. + +## Device UI + +The left button (`BTN-1`) is used to enable provisioning (provisioning is +enabled as "oneshot" by default). The right button (`BTN-2`) long press is used +to reset the device. + +## Building + +### Preparation + +Some initial setup is necessary for preparing the build environment. This +section will need to be done when migrating to new versions of the SDK. This +guide assumes that the environment is linux based, and recommends Ubuntu 20.04. + +- Download and install [SysConfig][sysconfig] ([recommended + version][sysconfig_recommended]). This can be done simply with the following + commands. + + ``` + $ cd ~ + $ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.13.0_2553-setup.run + $ chmod +x sysconfig-1.13.0_2553-setup.run + $ ./sysconfig-1.13.0_2553-setup.run + ``` + +- Run the bootstrap script to setup the build environment. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/bootstrap.sh + ``` + +### Compilation + +It is necessary to activate the environment in every new shell. Then run GN and +Ninja to build the executable. + +- Activate the build environment with the repository activate script. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/activate.sh + ``` + +- Run the build to produce a default executable. By default on Linux the + Sysconfig is located in a `ti` folder in the user's home directory, and you + must provide the absolute path for it. For example + `/home/username/ti/sysconfig_1.13.0`. On Windows the default directory is + `C:\ti`. Take note of this install path, as it will be used in the next + step. + + ``` + $ cd ~/connectedhomeip/examples/air-purifier-app/cc32xx + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.13.0\"" + $ ninja -C out/debug + ``` + +## Adding DAC Certificates + +To add custom DAC Certificates, the `CC32XXDeviceAttestationCreds.cpp` file in +`examples/platform/cc32xx` can be modified. The private key, public key, DAC +cert and PAI cert arrays all need to be replaced. + +## Programming + +Loading the built image onto a LaunchPad is supported through Code Composer +Studio (CCS). Code Composer Studio can be used to load the image and debug the +source code. UniFlash programming (bin) image is not generated currently. + +### Code Composer Studio + +Programming with CCS will allow for a full debug environment within the IDE. +This is accomplished by creating a target connection to the XDS110 debugger and +starting a project-less debug session. The CCS IDE will attempt to find the +source files on the local machine based on the debug information embedded within +the ELF. CCS may prompt you to find the source code if the image was built on +another machine or the source code is located in a different location than is +recorded within the ELF. + +Download and install [Code Composer Studio][ccs]. + +First open CCS and create a new workspace. + +Create a target connection (sometimes called the CCXML) for your target SoC and +debugger as described in the [Manual Method][ccs_manual_method] section of the +CCS User's Guide. + +Next initiate a project-less debug session as described in the [Manual +Launch][ccs_manual_launch] section of the CCS User's Guide. + +CCS should switch to the debug view described in the [After +Launch][ccs_after_launch] section of the User's Guide. The SoC core will likely +be disconnected and symbols will not be loaded. Connect to the core as described +in the [Debug View][ccs_debug_view] section of the User's Guide. Once the core +is connected, use the `Load` button on the toolbar to load the ELF image. + +Note that the default configuration of the CCXML uses 2-wire cJTAG instead of +the full 4-wire JTAG connection to match the default jumper configuration of the +LaunchPad. + +## Viewing Logging Output + +By default the log output will be sent to the Application/User UART. Open a +terminal emulator to that port to see the output with the following options: + +| Parameter | Value | +| ------------ | -------- | +| Speed (baud) | `115200` | +| Data bits | `8` | +| Stop bits | `1` | +| Parity | `None` | +| Flow control | `None` | + +## Running the Example + +### Provisioning + +The first step to bring the Matter device onto the network is to provision it. +The example accomplishes this through the proprietary SimpleLink provisioning +method (AP or Smart Config) using the SimpleLink Starter Pro mobile app. Once +the device is connected to the local AP, commissioning can be triggered using +"OnNetwork" configuration. + +#### Bluetooth LE Provisioning + +BLE provisioning is not supported currently. diff --git a/examples/air-purifier-app/cc32xx/args.gni b/examples/air-purifier-app/cc32xx/args.gni new file mode 100755 index 00000000000000..aaf39441ba3490 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/args.gni @@ -0,0 +1,44 @@ +# 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") +import("${chip_root}/examples/platform/cc32xx/args.gni") + +ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain") +ti_simplelink_sysconfig_target = + get_label_info(":sysconfig", "label_no_toolchain") + +ti_simplelink_board = "CC3235SF_LAUNCHXL" + +# use -Os instead of -Og +#is_debug = false + +# disable BLE for now +chip_config_network_layer_ble = false +chip_bypass_rendezvous = false + +#enable logging +chip_progress_logging = true +chip_detail_logging = true +chip_automation_logging = true + +## Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" + +matter_device_vid = "0xFFF1" +matter_device_pid = "0x8006" +matter_software_ver = "0x0001" +matter_software_ver_str = "1.0d1" diff --git a/examples/air-purifier-app/cc32xx/build_overrides b/examples/air-purifier-app/cc32xx/build_overrides new file mode 120000 index 00000000000000..194ee0b812dc3d --- /dev/null +++ b/examples/air-purifier-app/cc32xx/build_overrides @@ -0,0 +1 @@ +../../build_overrides/ \ No newline at end of file diff --git a/examples/air-purifier-app/cc32xx/chip.syscfg b/examples/air-purifier-app/cc32xx/chip.syscfg new file mode 100755 index 00000000000000..14fd3130d99c4f --- /dev/null +++ b/examples/air-purifier-app/cc32xx/chip.syscfg @@ -0,0 +1,74 @@ +/** + * Import the modules used in this configuration. + */ +const Display = scripting.addModule("/ti/display/Display"); +const Display1 = Display.addInstance(); +const SPI = scripting.addModule("/ti/drivers/SPI"); +const Button = scripting.addModule("/ti/drivers/apps/Button"); +const Button1 = Button.addInstance(); +const Button2 = Button.addInstance(); +const LED = scripting.addModule("/ti/drivers/apps/LED"); +const LED1 = LED.addInstance(); +const LED2 = LED.addInstance(); +const LED3 = LED.addInstance(); +const SimpleLinkWifi = scripting.addModule("/ti/drivers/net/wifi/SimpleLinkWifi"); +const net_utils = scripting.addModule("/ti/drivers/net/wifi/net_utils", {}, false); +const net_utils1 = net_utils.addInstance(); +const HTTPClient = scripting.addModule("/ti/net/HTTPClient", {}, false); +const HTTPClient1 = HTTPClient.addInstance(); +const MQTT = scripting.addModule("/ti/net/MQTT", {}, false); +const MQTT1 = MQTT.addInstance(); +const SNTP = scripting.addModule("/ti/net/SNTP"); +const SlNet = scripting.addModule("/ti/net/SlNet", {}, false); +const SlNet1 = SlNet.addInstance(); + +/** + * Write custom configuration values to the imported modules. + */ +Display1.$name = "CONFIG_Display_0"; +Display1.$hardware = system.deviceData.board.components.XDS110UART; +Display1.uart.$name = "CONFIG_UART2_0"; + +const Power = scripting.addModule("/ti/drivers/Power", {}, false); +Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0"; + +Button1.$hardware = system.deviceData.board.components.SW2; +Button1.$name = "CONFIG_BTN_LEFT"; + +Button2.$hardware = system.deviceData.board.components.SW3; +Button2.$name = "CONFIG_BTN_RIGHT"; + +LED1.$hardware = system.deviceData.board.components.LED_BLUE; +LED1.$name = "CONFIG_LED_BLUE"; + +LED2.$hardware = system.deviceData.board.components.LED_GREEN; +LED2.$name = "CONFIG_LED_GREEN"; + +LED3.$hardware = system.deviceData.board.components.LED_RED; +LED3.dimmable = true; +LED3.$name = "CONFIG_LED_RED"; + +net_utils1.$name = "CONFIG_NET_UTILS_0"; + +HTTPClient1.$name = "CONFIG_HTTPCLIENT_0"; + +MQTT1.$name = "CONFIG_MQTT_0"; + +SlNet1.$name = "CONFIG_SLNET_0"; + +/** + * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future + * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to + * re-solve from scratch. + */ +Display1.uart.uart.$suggestSolution = "UART1"; +Display1.uart.uart.txPin.$suggestSolution = "ball.55"; +Display1.uart.uart.txDmaChannel.$suggestSolution = "UDMA_CH11"; +Display1.uart.uart.rxPin.$suggestSolution = "ball.57"; +Display1.uart.uart.rxDmaChannel.$suggestSolution = "UDMA_CH10"; +Button1.button.$suggestSolution = "boosterpack.3"; +Button2.button.$suggestSolution = "boosterpack.11"; +LED1.ledPin.$suggestSolution = "boosterpack.29"; +LED2.ledPin.$suggestSolution = "boosterpack.10"; +LED3.pwmPin.timer.$suggestSolution = "Timer3"; +LED3.pwmPin.timer.pwmPin.$suggestSolution = "boosterpack.9"; diff --git a/examples/air-purifier-app/cc32xx/main/AppConfig.h b/examples/air-purifier-app/cc32xx/main/AppConfig.h new file mode 100755 index 00000000000000..913188f41fab36 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/AppConfig.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// Logging +#ifdef __cplusplus +extern "C" { +#endif + +int cc32xxLogInit(void); +void cc32xxLog(const char * aFormat, ...); +#define PLAT_LOG(...) cc32xxLog(__VA_ARGS__); + +#ifdef __cplusplus +} +#endif diff --git a/examples/air-purifier-app/cc32xx/main/AppEvent.h b/examples/air-purifier-app/cc32xx/main/AppEvent.h new file mode 100755 index 00000000000000..de612090ee8c01 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/AppEvent.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventType + { + kEventType_None = 0, + kEventType_ButtonLeft, + kEventType_ButtonRight, + kEventType_AppEvent, + }; + + enum AppEventButtonType + { + kAppEventButtonType_None = 0, + kAppEventButtonType_Clicked, + kAppEventButtonType_LongClicked, + }; + + enum AppEventType Type; + + union + { + struct + { + enum AppEventButtonType Type; + } ButtonEvent; + + struct + { + void * Context; + } BoltLockEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/air-purifier-app/cc32xx/main/AppTask.cpp b/examples/air-purifier-app/cc32xx/main/AppTask.cpp new file mode 100644 index 00000000000000..fa112c1ee23a21 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/AppTask.cpp @@ -0,0 +1,282 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "AppConfig.h" +#include "AppEvent.h" + +#include +#include +#include +#include + +#include "FreeRTOS.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +/* syscfg */ +#include +#include + +extern "C" { +extern int WiFi_init(); +extern void DisplayBanner(); +} + +#define APP_TASK_STACK_SIZE (4096) +#define APP_TASK_PRIORITY 4 +#define APP_EVENT_QUEUE_SIZE 10 + +#define AIR_PURIFIER_ENDPOINT 1 +#define AIR_QUALITY_SENSOR_ENDPOINT 2 +#define RELATIVE_HUMIDITY_SENSOR_ENDPOINT 3 +#define TEMPERATURE_SENSOR_ENDPOINT 4 + +// Added the below three for DNS Server Initialization +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; + +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceManager; + +using namespace chip::app; +using namespace chip::app::Clusters; + +static TaskHandle_t sAppTaskHandle; +static QueueHandle_t sAppEventQueue; + +extern LED_Handle gLedGreenHandle, gLedRedHandle; +static Button_Handle gButtonRightHandle; + +AppTask AppTask::sAppTask; + +static DeviceCallbacks EchoCallbacks; + +int AppTask::StartAppTask() +{ + int ret = 0; + + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + PLAT_LOG("Failed to allocate app event queue"); + while (true) + ; + } + + // Start App task. + if (xTaskCreate(AppTaskMain, "APP", APP_TASK_STACK_SIZE / sizeof(StackType_t), NULL, APP_TASK_PRIORITY, &sAppTaskHandle) != + pdPASS) + { + PLAT_LOG("Failed to create app task"); + while (true) + ; + } + return ret; +} + +int AppTask::Init() +{ + CHIP_ERROR ret; + LED_Params ledParams; + Button_Params buttonParams; + + cc32xxLogInit(); + + /* Initial Terminal, and print Application name */ + DisplayBanner(); + + // Init Chip memory management before the stack + PLAT_LOG("Initialize Memory"); + chip::Platform::MemoryInit(); + + // Initialize LEDs + PLAT_LOG("Initialize LEDs"); + LED_init(); + + LED_Params_init(&ledParams); // default PWM LED + gLedRedHandle = LED_open(CONFIG_LED_RED, &ledParams); + LED_setOff(gLedRedHandle); + + LED_Params_init(&ledParams); // default PWM LED + gLedGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams); + LED_setOff(gLedGreenHandle); + + // Initialize buttons + PLAT_LOG("Initialize buttons"); + Button_init(); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + gButtonRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams); + Button_setCallback(gButtonRightHandle, ButtonRightEventHandler); + + PLAT_LOG("Initialize Wi-Fi"); + WiFi_init(); + + PLAT_LOG("Initialize CHIP stack"); + ret = PlatformMgr().InitChipStack(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("PlatformMgr().InitChipStack() failed"); + while (true) + ; + } + + // Init ZCL Data Model and start server + PLAT_LOG("Initialize Server"); + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + chip::Server::GetInstance().Init(initParams); + + // Initialize device attestation config + PLAT_LOG("Initialize device attestation config"); +#ifdef CC32XX_ATTESTATION_CREDENTIALS + SetDeviceAttestationCredentialsProvider(CC32XX::GetCC32XXDacProvider()); +#else + + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); +#endif + + // init air purifier stuff + SetParentEndpointForEndpoint(AIR_QUALITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(TEMPERATURE_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(RELATIVE_HUMIDITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + + AirPurifierManager::InitInstance(EndpointId(AIR_PURIFIER_ENDPOINT), EndpointId(AIR_QUALITY_SENSOR_ENDPOINT), + EndpointId(TEMPERATURE_SENSOR_ENDPOINT), EndpointId(RELATIVE_HUMIDITY_SENSOR_ENDPOINT)); + + ConfigurationMgr().LogDeviceConfig(); + + // QR code will be used with CHIP Tool + PLAT_LOG("Print Onboarding Codes"); + PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kOnNetwork)); + + PLAT_LOG("Start CHIPDeviceManager and Start Event Loop Task"); + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + ret = deviceMgr.Init(&EchoCallbacks); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("CHIPDeviceManager::Init() failed: %s", ErrorStr(ret)); + while (1) + ; + } + + return 0; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + sAppTask.Init(); + + while (true) + { + /* Task pend until we have stuff to do */ + if (xQueueReceive(sAppEventQueue, &event, portMAX_DELAY) == pdTRUE) + { + sAppTask.DispatchEvent(&event); + } + } +} + +void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask events) +{ + AppEvent event; + event.Type = AppEvent::kEventType_ButtonRight; + + if (events & Button_EV_CLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; + } + else if (events & Button_EV_LONGCLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + } + // button callbacks are in ISR context + if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) + { + /* Failed to post the message */ + } +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (xQueueSend(sAppEventQueue, aEvent, 0) != pdPASS) + { + /* Failed to post the message */ + } +} + +// need to define custom tokens to read/write files from the file system +#define KVS_TOKEN 0x13578642 + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + switch (aEvent->Type) + { + case AppEvent::kEventType_ButtonRight: + if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) + { + PLAT_LOG("DispatchEvent: kEventType_ButtonRight: kAppEventButtonType_Clicked"); + } + if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) + { + // delete the kvs.cfg file and reset the matter part of the device + PLAT_LOG("DispatchEvent: kEventType_ButtonRight: LONG clicked - clearing KVS"); + + uint32_t token = KVS_TOKEN; + const unsigned char listName[] = "/sys/matter/kvs.cfg"; + sl_FsDel(listName, token); + } + break; + case AppEvent::kEventType_AppEvent: + if (NULL != aEvent->Handler) + { + // XXX: assume our caller isn't trying to crash our stack + aEvent->Handler(aEvent); + } + break; + + case AppEvent::kEventType_None: + default: + break; + } +} diff --git a/examples/air-purifier-app/cc32xx/main/AppTask.h b/examples/air-purifier-app/cc32xx/main/AppTask.h new file mode 100644 index 00000000000000..1d16f8eeb82696 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/AppTask.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 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. + */ + +#pragma once + +#include +#include + +#include "FreeRTOS.h" +#include "semphr.h" +#include "task.h" + +#include "AppEvent.h" +#include + +class AppTask +{ +public: + int StartAppTask(); + static void AppTaskMain(void * pvParameter); + + void PostEvent(const AppEvent * event); + +private: + friend AppTask & GetAppTask(void); + + int Init(); + + void DispatchEvent(AppEvent * event); + + static void ButtonRightEventHandler(Button_Handle handle, Button_EventMask events); + + static void TimerEventHandler(void * p_context); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_FactoryReset, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/air-purifier-app/cc32xx/main/CHIPDeviceManager.cpp b/examples/air-purifier-app/cc32xx/main/CHIPDeviceManager.cpp new file mode 100644 index 00000000000000..399c527e47edef --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/CHIPDeviceManager.cpp @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the CHIP Device Interface that is used by + * applications to interact with the CHIP stack + * + */ + +#include + +#include "CHIPDeviceManager.h" + +using namespace ::chip; + +namespace chip { + +namespace DeviceManager { + +using namespace ::chip::DeviceLayer; + +void CHIPDeviceManager::DeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); + if (cb != nullptr) + { + cb->DeviceEventCallback(event, reinterpret_cast(cb)); + } +} + +CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) +{ + mCB = cb; + + // Register a function to receive events from the CHIP device layer. Note that calls to + // this function will happen on the CHIP event loop thread, not the app_main thread. + PlatformMgr().AddEventHandler(CHIPDeviceManager::DeviceEventHandler, reinterpret_cast(cb)); + + // Start a task to run the CHIP Device event loop. + return PlatformMgr().StartEventLoopTask(); +} + +void CHIPDeviceManagerCallbacks::DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) {} + +CHIPDeviceManagerCallbacks::~CHIPDeviceManagerCallbacks() {} + +} // namespace DeviceManager +} // namespace chip diff --git a/examples/air-purifier-app/cc32xx/main/CXXExceptionStubs.cpp b/examples/air-purifier-app/cc32xx/main/CXXExceptionStubs.cpp new file mode 100755 index 00000000000000..39845ce7604c82 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/CXXExceptionStubs.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 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. + */ + +/** + * @file + * Stub implementations of the C++ ABI exception handling functions. + * + * These functions replace the standard C++ exception code from the system's + * C++ runtime library with stub implementations that simply abort. This + * reduces overall code size as well as eliminating some calls to malloc() + * that occur during global initialization (see the code in eh_alloc.cc). + * This provides significant memory savings on resource constrained devices + * that don't use exceptions. + * + */ + +#include + +extern "C" { + +void * __cxa_allocate_exception(size_t) +{ + abort(); +} + +void __cxa_free_exception(void *) +{ + abort(); +} + +void * __cxa_allocate_dependent_exception() +{ + abort(); +} + +void __cxa_free_dependent_exception(void *) +{ + abort(); +} + +void __cxa_throw(void *, void *, void (*)(void *)) +{ + abort(); +} + +void __cxa_rethrow() +{ + abort(); +} + +void * __cxa_begin_catch(void *) +{ + abort(); +} + +void __cxa_end_catch() +{ + abort(); +} + +void * __cxa_get_exception_ptr(void *) +{ + abort(); +} +} diff --git a/examples/air-purifier-app/cc32xx/main/DeviceCallbacks.cpp b/examples/air-purifier-app/cc32xx/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..71ec0909cc206b --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/DeviceCallbacks.cpp @@ -0,0 +1,45 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DeviceCallbacks.h" +#include + +using namespace chip; +using namespace chip::DeviceLayer; +using namespace chip::System; + +DeviceCallbacksDelegate * appDelegate = nullptr; +extern "C" void cc32xxLog(const char * aFormat, ...); + +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kInterfaceIpAddressChanged: + if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || + (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) + { + // MDNS server restart on any ip assignment: if link local ipv6 is configured, that + // will not trigger a 'internet connectivity change' as there is no internet + // connectivity. MDNS still wants to refresh its listening interfaces to include the + // newly selected address. + cc32xxLog("DeviceEventCallback:Start DNS Server"); + chip::app::DnssdServer::Instance().StartServer(); + } + } +} diff --git a/examples/air-purifier-app/cc32xx/main/ZclCallbacks.cpp b/examples/air-purifier-app/cc32xx/main/ZclCallbacks.cpp new file mode 100644 index 00000000000000..7e780d7050f06e --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/ZclCallbacks.cpp @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppConfig.h" + +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + if (attributePath.mClusterId == OnOff::Id && attributePath.mAttributeId == OnOff::Attributes::OnOff::Id) + { + PLAT_LOG("MatterPostAttributeChangeCallback from zclCallbacks.cpp"); + } + if (AirPurifierManager::GetInstance() != nullptr) + { + AirPurifierManager::GetInstance()->PostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, + attributePath.mAttributeId, type, size, value); + } +} + +/** @brief OnOff Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + * TODO Issue #3841 + * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster + * attributes to the default value. + * The logic here expects something similar to the deprecated Plugins callback + * emberAfPluginOnOffClusterServerPostInitCallback. + * + */ +void emberAfOnOffClusterInitCallback(EndpointId endpoint) +{ + // TODO: implement any additional Cluster Server init actions +} diff --git a/examples/air-purifier-app/cc32xx/main/cc32xxWifiInit.c b/examples/air-purifier-app/cc32xx/main/cc32xxWifiInit.c new file mode 100644 index 00000000000000..2f6230d1487c12 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/cc32xxWifiInit.c @@ -0,0 +1,243 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * 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. + */ + +//**************************************************************************** +// +//! \addtogroup +//! @{ +// +//**************************************************************************** + +/* Standard Include */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* TI-DRIVERS Header files */ +#include +#include + +#include + +#include + +#include +#include + +#include "ti_drivers_config.h" +#include +#include +#include +#include +#include +#include +#include + +#include "utils_if.h" +#include "wifi_if.h" + +#include +int CHIP_IF_init(); + +/* Application Version and Naming*/ +#define APPLICATION_NAME "CC32XX-MATTER:: E-LOCK" +#define APPLICATION_VERSION "01.00.00.00" + +/* USER's defines */ +#define SLNETCONN_TASK_STACK_SIZE (2048) +#define DISPLAY_TASK_STACK_SIZE (512) + +/**************************************************************************** + LOCAL FUNCTION PROTOTYPES + ****************************************************************************/ +static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events); + +/**************************************************************************** + EXT. FUNCTION PROTOTYPES + ****************************************************************************/ +extern void LWIP_IF_start(); + +/**************************************************************************** + GLOBAL VARIABLES + ****************************************************************************/ +pthread_t gSlNetConnThread = (pthread_t) NULL; +Button_Handle gButtonLeftHandle, gButtonRightHandle; +LED_Handle gLedBlueHandle, gLedGreenHandle, gLedRedHandle; + +/**************************************************************************** + STATIC VARIABLES + ****************************************************************************/ +static bool gIsConnected = 0; + +//***************************************************************************** +// Local Functions +//***************************************************************************** + +void SimpleLinkSockEventHandler(SlSockEvent_t * pSock) +{ + /* Unused in this application */ +} + +void SimpleLinkHttpServerEventHandler(SlNetAppHttpServerEvent_t * pHttpEvent, SlNetAppHttpServerResponse_t * pHttpResponse) +{ + /* Unused in this application */ +} + +void SimpleLinkNetAppRequestEventHandler(SlNetAppRequest_t * pNetAppRequest, SlNetAppResponse_t * pNetAppResponse) +{ + /* Unused in this application */ +} + +void SimpleLinkNetAppRequestMemFreeEventHandler(uint8_t * buffer) +{ + /* Unused in this application */ +} + +//***************************************************************************** +// +//! \brief Application startup display on UART +//! +//! \param none +//! +//! \return none +//! +//***************************************************************************** +void DisplayBanner() +{ + cc32xxLog("\n\n\n\r"); + cc32xxLog("\t\t *************************************************\n\r"); + cc32xxLog("\t\t %s Application \n\r", APPLICATION_NAME); + cc32xxLog("\t\t %s \n\r", APPLICATION_VERSION); + cc32xxLog("\t\t *************************************************\n\r"); + cc32xxLog("\n\n\n\r"); +} + +//***************************************************************************** +// +//! \brief SlWifiConn Event Handler +//! +//***************************************************************************** +void SlNetConnEventHandler(uint32_t ifID, SlNetConnStatus_e netStatus, void * data) +{ + switch (netStatus) + { + case SLNETCONN_STATUS_CONNECTED_MAC: + gIsConnected = 1; + LED_setOn(gLedBlueHandle, LED_BRIGHTNESS_MAX); + cc32xxLog("[SlNetConnEventHandler] I/F %d - CONNECTED (MAC LEVEL)!\n\r", ifID); + break; + case SLNETCONN_STATUS_CONNECTED_IP: + gIsConnected = 1; + cc32xxLog("[SlNetConnEventHandler] I/F %d - CONNECTED (IP LEVEL)!\n\r", ifID); + break; + case SLNETCONN_STATUS_CONNECTED_INTERNET: + gIsConnected = 1; + cc32xxLog("[SlNetConnEventHandler] I/F %d - CONNECTED (INTERNET LEVEL)!\n\r", ifID); + break; + case SLNETCONN_STATUS_WAITING_FOR_CONNECTION: + case SLNETCONN_STATUS_DISCONNECTED: + gIsConnected = 0; + LED_setOff(gLedBlueHandle); + cc32xxLog("[SlNetConnEventHandler] I/F %d - DISCONNECTED!\n\r", ifID); + break; + default: + cc32xxLog("[SlNetConnEventHandler] I/F %d - UNKNOWN STATUS\n\r", ifID); + break; + } +} + +//***************************************************************************** +// +//! \brief Launchpad switch used to enable one shot provisioning +//! +//***************************************************************************** +static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events) +{ + // Enable Provisioning + int retVal = SlWifiConn_enableProvisioning(WifiProvMode_ONE_SHOT, PROVISIONING_CMD, 0); + assert(retVal == 0); +} + +//***************************************************************************** +// +//! \brief Main application thread +//! +//! \param none +//! +//! \return none +//! +//***************************************************************************** +int WiFi_init() +{ + int retVal; + Button_Params buttonParams; + LED_Params ledParams; + + SPI_init(); + +#ifdef NWP_LOG + // NWP log config + // If your application already has UART0 configured, no need for this line + MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK); + // Mux Pin 62 to mode 1 for outputting NWP logs + MAP_PinTypeUART(PIN_62, PIN_MODE_1); +#endif + + LED_Params_init(&ledParams); // default PWM LED + gLedBlueHandle = LED_open(CONFIG_LED_BLUE, &ledParams); + LED_setOff(gLedBlueHandle); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + gButtonLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams); + Button_setCallback(gButtonLeftHandle, ButtonLeftEventHandler); + + /* Enable SlWifiConn */ + retVal = WIFI_IF_init(); + assert(retVal >= 0); + + /* Enable SlNet framework */ + retVal = ti_net_SlNet_initConfig(); + assert(retVal == 0); + + /* Enable SlNetConn */ + retVal = SlNetConn_init(0); + assert(retVal == 0); + gSlNetConnThread = OS_createTask(1, SLNETCONN_TASK_STACK_SIZE, SlNetConn_process, NULL, OS_TASK_FLAG_DETACHED); + assert(gSlNetConnThread); + + return (retVal); +} + +int WiFi_deinit() +{ + int retVal; + cc32xxLog("[APP] Networking App Completed (entering low power mode)\r\n "); + retVal = SlNetConn_stop(SlNetConnEventHandler); + retVal = WIFI_IF_deinit(); + cc32xxLog("[APP] Exit (%d) \r\n", retVal); + assert(retVal == 0); + return (retVal); +} diff --git a/examples/air-purifier-app/cc32xx/main/debug_settings.h b/examples/air-purifier-app/cc32xx/main/debug_settings.h new file mode 100644 index 00000000000000..16f826dae2f124 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/debug_settings.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//***************************************************************************** +// Includes +//***************************************************************************** +// Standard includes +#pragma once + +// Select the print method used in the main app +#define D_DEBUG_METHOD D_USER_DEFINED + +// Select Sevrity Color +#define _FATAL_CLR_ _CLR_B_RED_ +#define _ERROR_CLR_ _CLR_RED_ +#define _WARNING_CLR_ _CLR_MAGENTA_ +#define _INFO_CLR_ _CLR_GREEN_ +#define _DEBUG_CLR_ _CLR_YELLOW_ +#define _TRACE_CLR_ _CLR_RESET_ + +#if (D_DEBUG_METHOD == D_USER_DEFINED) +extern void cc32xxLog(const char * msg, ...); +#define PRINTF(...) cc32xxLog(__VA_ARGS__); +#endif diff --git a/examples/air-purifier-app/cc32xx/main/include/CHIPDeviceManager.h b/examples/air-purifier-app/cc32xx/main/include/CHIPDeviceManager.h new file mode 100644 index 00000000000000..939bf3149a4695 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/include/CHIPDeviceManager.h @@ -0,0 +1,106 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains definitions for the CHIP DeviceManager Interface + * + * This object will co-ordinate multiple activities such as + * initialisation, rendezvous, session mgmt and other such + * activities within the CHIP stack. This is a singleton object. + */ + +#pragma once + +#include +#include +#include + +#include + +#include +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class DLL_EXPORT CHIPDeviceManagerCallbacks +{ +public: + /** + * @brief + * Called when CHIP Device events (PublicEventTypes) are triggered. + * + * @param event ChipDeviceEvent that occurred + * @param arg arguments specific to the event, if any + */ + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + + virtual ~CHIPDeviceManagerCallbacks(); +}; + +/** + * @brief + * A common class that drives other components of the CHIP stack + */ +class DLL_EXPORT CHIPDeviceManager +{ +public: + CHIPDeviceManager(const CHIPDeviceManager &) = delete; + CHIPDeviceManager(const CHIPDeviceManager &&) = delete; + CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete; + + static CHIPDeviceManager & GetInstance() + { + static CHIPDeviceManager instance; + return instance; + } + + /** + * @brief + * Initialise CHIPDeviceManager + * + * @param cb Application's instance of the CHIPDeviceManagerCallbacks for consuming events + */ + CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + + /** + * @brief + * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. + * + */ + CHIPDeviceManagerCallbacks * GetCHIPDeviceManagerCallbacks() { return mCB; } + + /** + * Use internally for registration of the ChipDeviceEvents + */ + static void DeviceEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + +private: + CHIPDeviceManagerCallbacks * mCB = nullptr; + CHIPDeviceManager() {} +}; + +} // namespace DeviceManager +} // namespace chip diff --git a/examples/air-purifier-app/cc32xx/main/include/CHIPProjectConfig.h b/examples/air-purifier-app/cc32xx/main/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..0765b2084a0870 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/include/CHIPProjectConfig.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2023 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. + */ + +/** + * @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. + * + */ + +#pragma once + +#if BUILD_RELEASE + +// Security and Authentication enabled for release build. +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +#else + +// Security and Authentication disabled for development build. +// For convenience, enable CHIP Security Test Mode and disable the requirement for +// authentication in various protocols. +// WARNING: These options make it possible to circumvent basic CHIP security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x002D // Air Purifier +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Air Purifier" + +/** + * CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER "DUMMY_SN" + +#endif // BUILD_RELEASE + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xE100: Google's Vendor Id. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0xFE00: SDK Sample Lock Resource + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * + * The product revision number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software revisions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION + * + * A string identifying the firmware revision running on the device. + * CHIP currently expects the firmware version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION +#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION "1.0d1" +#endif +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for CHIP-over-BLE (CHIPOBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif diff --git a/examples/air-purifier-app/cc32xx/main/include/DeviceCallbacks.h b/examples/air-purifier-app/cc32xx/main/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..c5c9e208e698d8 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/include/DeviceCallbacks.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); +}; + +class DeviceCallbacksDelegate +{ +public: + static DeviceCallbacksDelegate & Instance() + { + static DeviceCallbacksDelegate instance; + return instance; + } + DeviceCallbacksDelegate * mDelegate = nullptr; + void SetAppDelegate(DeviceCallbacksDelegate * delegate) { mDelegate = delegate; } + DeviceCallbacksDelegate * GetAppDelegate() { return mDelegate; } +}; diff --git a/examples/air-purifier-app/cc32xx/main/main.cpp b/examples/air-purifier-app/cc32xx/main/main.cpp new file mode 100644 index 00000000000000..0e332752802a5d --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/main.cpp @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2020 Texas Instruments Incorporated + * + * 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 +#include + +#include + +/* Driver Header files */ +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +extern "C" void vApplicationStackOverflowHook(void) +{ + while (true) + { + ; + } +} + +// ================================================================================ +// Main Code +// ================================================================================ +int main(void) +{ + Board_init(); + GPIO_init(); + + mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); + + int ret = GetAppTask().StartAppTask(); + if (ret != 0) + { + // can't log until the kernel is started + // PLAT_LOG("GetAppTask().StartAppTask() failed"); + while (true) + ; + } + + vTaskStartScheduler(); + + // Should never get here. + while (true) + ; +} diff --git a/examples/air-purifier-app/cc32xx/main/wifi_settings.h b/examples/air-purifier-app/cc32xx/main/wifi_settings.h new file mode 100644 index 00000000000000..21bf90941b4772 --- /dev/null +++ b/examples/air-purifier-app/cc32xx/main/wifi_settings.h @@ -0,0 +1,99 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//***************************************************************************** +// Includes +//***************************************************************************** +#pragma once + +//***************************************************************************** +// WIFI IF INTRODUCTION +//***************************************************************************** +/* This module enables an easy integration of Wi-Fi to a SimpleLink Networking + * framework. + * It was designed for applications that use the Wi-Fi Station role only. + * The simple API and settings enables the user to initiate the Wi-Fi and + * configure the provisioning method that will be used upon first connection + * attempt. + * Upon successful init (WIFI_IF_init()), the system enables the NWP for any + * SL commands. + * The NWP will be in a low power state (AUTO-CONNECT will be disabled) waiting + * for connection request (SlNetConn_Start()). + * User should not call sl_Start/sl_Stop when using this module. Please use + * WIFI_IF_restart() (for reseting the NWP) or WIFI_IF_deinit() instead. + */ + +//***************************************************************************** +// WIFI IF USER SETTINGS +//***************************************************************************** + +/* + * Defines the minimum severity level allowed. + * Use E_DEBUG to enable Wifi internal messages + * Options: E_TRACE, E_DEBUG, E_INFO, E_WARNING, E_ERROR, E_FATAL + */ +#define WIFI_IF_DEBUG_LEVEL E_INFO + +/* + * Defines Provisioning (initial) Parameters: + * Mode can be: WifiProvMode_OFF, WifiProvMode_ON, WifiProvMode_ONE_SHOT + * Command can be one of the following: + * SL_WLAN_PROVISIONING_CMD_START_MODE_AP, + * SL_WLAN_PROVISIONING_CMD_START_MODE_SC, + * SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, + * SL_WLAN_PROVISIONING_CMD_START_MODE_APSC_EXTERNAL_CONFIGURATION, + * SL_WLAN_PROVISIONING_CMD_START_MODE_EXTERNAL_CONFIGURATION + */ +#define PROVISIONING_MODE WifiProvMode_ONE_SHOT +#define PROVISIONING_CMD SL_WLAN_PROVISIONING_CMD_START_MODE_APSC + +/* + * Defines Provisioning AP /SC Parameters: + */ +#define PROVISIONING_TIMEOUT 0 // 0 - use default +#define PROVISIONING_AP_PASSWORD "1234567890" // NULL - use default (OPEN) +#define PROVISIONING_SC_KEY "1234567890123456" // NULL - use defaults + +/* Force provisioning by deleting existing profiles. + * To be used for testing during development only. + * Note: When FORCE_PROVSIONING is enabled - the following static profile + * configurations are ignored + */ +#define FORCE_PROVISIONING (0) + +/* Static Profile setting - Method 1: Hard coded + * Define AP_SSID and optionally AP_PASSWORD - to connect to local network + * Hard-Coded Definition: update AP_SSID and AP_PASSWORD (NULL means OPEN, else is WPA2) + */ +#define AP_SSID NULL // "network-name" +#define AP_PASSWORD NULL // "network-password" + +/* Static Profile setting - Method 2: Configuration file + * File format should be: + * "' '" + * i.e. ssid and password with one space character between them + * Do not use newline, extra space symbols or quotation mark + */ +#define AP_CFG_FILENAME "network.cfg" // config file name +#define AP_CFG_TOKEN 12345678 // config file read access token +#define AP_CFG_MAX_SIZE 100 // config file Maximum file length + +/* Define (if needed) the external handle for TI Driver's LED for wi-fi status: + * off: disconnected, blinking: provisionig, on: connected + * Comment the definition in case the auto control is not required */ +#define WIFI_LED_HANDLE gLedBlueHandle diff --git a/examples/air-purifier-app/cc32xx/third_party/connectedhomeip b/examples/air-purifier-app/cc32xx/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/air-purifier-app/cc32xx/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/air-purifier-app/linux/.gn b/examples/air-purifier-app/linux/.gn new file mode 100644 index 00000000000000..5d1ce757507582 --- /dev/null +++ b/examples/air-purifier-app/linux/.gn @@ -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/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 = { + import("//args.gni") +} diff --git a/examples/air-purifier-app/linux/BUILD.gn b/examples/air-purifier-app/linux/BUILD.gn new file mode 100644 index 00000000000000..0a0f86cac16ec4 --- /dev/null +++ b/examples/air-purifier-app/linux/BUILD.gn @@ -0,0 +1,61 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/build/chip/tools.gni") +import("${chip_root}/src/app/common_flags.gni") + +assert(chip_build_tools) + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("chip-air-purifier-app") { + sources = [ + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp", + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp", + "${chip_root}/examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp", + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/air-purifier-app/air-purifier-common", + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/lib", + ] + + cflags = [ "-Wconversion" ] + + include_dirs = [ + "include", + "${chip_root}/examples/air-purifier-app/air-purifier-common/include", + ] + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":chip-air-purifier-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/air-purifier-app/linux/README.md b/examples/air-purifier-app/linux/README.md new file mode 100644 index 00000000000000..88f5be738c926d --- /dev/null +++ b/examples/air-purifier-app/linux/README.md @@ -0,0 +1,109 @@ +# CHIP Linux Air Purifier Example + +An example showing the use of CHIP on the Linux. The document will describe how +to build and run CHIP Air Purifier Example on A Linux System. This doc is tested +on **Ubuntu 20.04 LTS**. + +The Air Purifier is a composed device with Endpoint 1 being the Air Purifier. +Endpoint 2 is an Air Quality Sensor, Endpoint 3 is a Relative Humidity Sensor +and endpoint 4 is a Temperature Sensor. + +To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** +**EVK**, see the associated +[README document](../../../docs/guides/nxp_imx8m_linux_examples.md) for details. + +
+ +- [CHIP Linux Air Purifier Example](#chip-linux-air-purifier-example) + - [Building](#building) + - [Commandline arguments](#commandline-arguments) + - [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4) + +
+ +## Building + +- Install tool chain + + $ sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev ninja-build python3-venv python3-dev unzip + +- Build the example application: + + $ cd ~/connectedhomeip/examples/air-purifier-app/linux/ + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ gn gen out/debug + $ ninja -C out/debug + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/examples/air-purifier-app/linux/ + $ rm -rf out/ + +## Commandline arguments + +- `--wifi` + + Enables WiFi management feature. Required for WiFi commissioning. + +- `--thread` + + Enables Thread management feature, requires ot-br-posix dbus daemon running. + Required for Thread commissioning. + +- `--ble-device ` + + Use specific bluetooth interface for BLE advertisement and connections. + + `interface id`: the number after `hci` when listing BLE interfaces by + `hciconfig` command, for example, `--ble-device 1` means using `hci1` + interface. Default: `0`. + +## Running the Complete Example on Raspberry Pi 4 + +> If you want to test Echo protocol, please enable Echo handler +> +> gn gen out/debug --args='chip_app_use_echo=true' +> ninja -C out/debug + +- Prerequisites + + 1. A Raspberry Pi 4 board + 2. A USB Bluetooth Dongle, Ubuntu desktop will send Bluetooth advertisement, + which will block CHIP from connecting via BLE. On Ubuntu server, you need + to install `pi-bluetooth` via APT. + 3. Ubuntu 20.04 or newer image for ARM64 platform. + +- Building + + Follow [Building](#building) section of this document. + +- Running + + - [Optional] Plug USB Bluetooth dongle + + - Plug USB Bluetooth dongle and find its bluetooth device number. The + number after `hci` is the bluetooth device number, `1` in this + example. + + $ hciconfig + hci1: Type: Primary Bus: USB + BD Address: 00:1A:7D:AA:BB:CC ACL MTU: 310:10 SCO MTU: 64:8 + UP RUNNING PSCAN ISCAN + RX bytes:20942 acl:1023 sco:0 events:1140 errors:0 + TX bytes:16559 acl:1011 sco:0 commands:121 errors:0 + + hci0: Type: Primary Bus: UART + BD Address: B8:27:EB:AA:BB:CC ACL MTU: 1021:8 SCO MTU: 64:1 + UP RUNNING PSCAN ISCAN + RX bytes:8609495 acl:14 sco:0 events:217484 errors:0 + TX bytes:92185 acl:20 sco:0 commands:5259 errors:0 + + - Run Linux Lighting Example App + + $ cd ~/connectedhomeip/examples/lighting-app/linux + $ sudo out/debug/chip-lighting-app --ble-device [bluetooth device number] + # In this example, the device we want to use is hci1 + $ sudo out/debug/chip-lighting-app --ble-device 1 + + - Test the device using ChipTool on your laptop / workstation etc. diff --git a/examples/air-purifier-app/linux/args.gni b/examples/air-purifier-app/linux/args.gni new file mode 100644 index 00000000000000..b91c0bafdfc9aa --- /dev/null +++ b/examples/air-purifier-app/linux/args.gni @@ -0,0 +1,25 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/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/air-purifier-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/air-purifier-app/linux/build_overrides b/examples/air-purifier-app/linux/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/air-purifier-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/air-purifier-app/linux/include/CHIPProjectAppConfig.h b/examples/air-purifier-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..e3a2e726e2db2a --- /dev/null +++ b/examples/air-purifier-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 0x002D // Air Purifier + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 + +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Air Purifier" diff --git a/examples/air-purifier-app/linux/main.cpp b/examples/air-purifier-app/linux/main.cpp new file mode 100644 index 00000000000000..59ef9cf9595755 --- /dev/null +++ b/examples/air-purifier-app/linux/main.cpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include +#include + +#define AIR_PURIFIER_ENDPOINT 1 +#define AIR_QUALITY_SENSOR_ENDPOINT 2 +#define TEMPERATURE_SENSOR_ENDPOINT 3 +#define RELATIVE_HUMIDITY_SENSOR_ENDPOINT 4 +// TODO: Add support for the thermostat endpoint in future PR. + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +// The MatterPostAttributeChangeCallback is offloaded to the main Air Purifier Manager class. +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + if (AirPurifierManager::GetInstance() != nullptr) + { + AirPurifierManager::GetInstance()->PostAttributeChangeCallback(attributePath.mEndpointId, attributePath.mClusterId, + attributePath.mAttributeId, type, size, value); + } +} + +// Initialize the Air Purifier Manager and set up the endpoint composition tree. +void ApplicationInit() +{ + AirPurifierManager::InitInstance(EndpointId(AIR_PURIFIER_ENDPOINT), EndpointId(AIR_QUALITY_SENSOR_ENDPOINT), + EndpointId(TEMPERATURE_SENSOR_ENDPOINT), EndpointId(RELATIVE_HUMIDITY_SENSOR_ENDPOINT)); + + SetParentEndpointForEndpoint(AIR_QUALITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(TEMPERATURE_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); + SetParentEndpointForEndpoint(RELATIVE_HUMIDITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT); +} + +void ApplicationShutdown() +{ + ChipLogDetail(NotSpecified, "Air Purifier: ApplicationShutdown()"); +} + +int main(int argc, char * argv[]) +{ + if (ChipLinuxAppInit(argc, argv) != 0) + { + return -1; + } + + ChipLinuxAppMainLoop(); + return 0; +} diff --git a/examples/air-purifier-app/linux/third_party/connectedhomeip b/examples/air-purifier-app/linux/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/air-purifier-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index f811b3164af645..736803eaad9c70 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,7 +43,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -76,13 +76,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -90,7 +90,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -148,7 +148,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -172,7 +172,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -235,20 +235,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -309,13 +309,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -323,7 +323,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -384,7 +384,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -392,7 +392,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -448,7 +448,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -464,7 +464,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -473,13 +473,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -588,7 +596,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -598,7 +606,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -612,7 +620,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -620,14 +628,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -693,8 +701,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -722,24 +730,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -749,7 +757,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -890,19 +898,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -911,7 +919,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -921,7 +929,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -964,7 +972,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -977,7 +985,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -998,26 +1006,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1030,7 +1042,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1044,12 +1056,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1091,7 +1103,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1099,14 +1111,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1129,12 +1141,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1145,7 +1157,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1160,12 +1172,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1232,7 +1244,7 @@ server cluster GroupKeyManagement = 63 { /** Attributes for reporting air quality classification */ server cluster AirQuality = 91 { - enum AirQualityEnum : ENUM8 { + enum AirQualityEnum : enum8 { kUnknown = 0; kGood = 1; kFair = 2; @@ -1242,7 +1254,7 @@ server cluster AirQuality = 91 { kExtremelyPoor = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kFair = 0x1; kModerate = 0x2; kVeryPoor = 0x4; @@ -1260,9 +1272,9 @@ server cluster AirQuality = 91 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1286,7 +1298,7 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes for reporting carbon monoxide concentration measurements */ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1294,13 +1306,13 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1311,7 +1323,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1333,7 +1345,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { /** Attributes for reporting carbon dioxide concentration measurements */ server cluster CarbonDioxideConcentrationMeasurement = 1037 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1341,13 +1353,13 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1358,7 +1370,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1380,7 +1392,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { /** Attributes for reporting nitrogen dioxide concentration measurements */ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1388,13 +1400,13 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1405,7 +1417,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1427,7 +1439,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { /** Attributes for reporting ozone concentration measurements */ server cluster OzoneConcentrationMeasurement = 1045 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1435,13 +1447,13 @@ server cluster OzoneConcentrationMeasurement = 1045 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1452,7 +1464,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1474,7 +1486,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { /** Attributes for reporting PM2.5 concentration measurements */ server cluster Pm25ConcentrationMeasurement = 1066 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1482,13 +1494,13 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1499,7 +1511,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1521,7 +1533,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { /** Attributes for reporting formaldehyde concentration measurements */ server cluster FormaldehydeConcentrationMeasurement = 1067 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1529,13 +1541,13 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1546,7 +1558,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1568,7 +1580,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { /** Attributes for reporting PM1 concentration measurements */ server cluster Pm1ConcentrationMeasurement = 1068 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1576,13 +1588,13 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1593,7 +1605,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1615,7 +1627,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { /** Attributes for reporting PM10 concentration measurements */ server cluster Pm10ConcentrationMeasurement = 1069 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1623,13 +1635,13 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1640,7 +1652,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1662,7 +1674,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { /** Attributes for reporting total volatile organic compounds concentration measurements */ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1670,13 +1682,13 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1687,7 +1699,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1709,7 +1721,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { /** Attributes for reporting radon concentration measurements */ server cluster RadonConcentrationMeasurement = 1071 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1717,13 +1729,13 @@ server cluster RadonConcentrationMeasurement = 1071 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1734,7 +1746,7 @@ server cluster RadonConcentrationMeasurement = 1071 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index f56a6027e9d092..13bfc7a3777a90 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -3243,7 +3243,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp index 8bc4f4c627925d..a6e94765d86cf8 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp @@ -136,8 +136,8 @@ void AirQualitySensorManager::Init() void AirQualitySensorManager::OnAirQualityChangeHandler(AirQualityEnum newValue) { - mAirQualityInstance.UpdateAirQuality(static_cast(newValue)); - ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", newValue); + mAirQualityInstance.UpdateAirQuality(newValue); + ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", chip::to_underlying(newValue)); } void AirQualitySensorManager::OnCarbonDioxideMeasurementChangeHandler(float newValue) diff --git a/examples/air-quality-sensor-app/telink/README.md b/examples/air-quality-sensor-app/telink/README.md index eecc7e8bbdbaa6..f91c701c00c527 100644 --- a/examples/air-quality-sensor-app/telink/README.md +++ b/examples/air-quality-sensor-app/telink/README.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for 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 4491adf35b3d88..99836125ba0451 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 @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -286,33 +286,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -355,33 +355,33 @@ client cluster OnOff = 6 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -430,23 +430,23 @@ server cluster OnOffSwitchConfiguration = 7 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -551,7 +551,7 @@ server cluster BinaryInputBasic = 15 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -590,7 +590,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -604,13 +604,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -618,7 +618,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -674,19 +674,19 @@ server cluster AccessControl = 31 { /** This cluster provides a standardized way for a Node (typically a Bridge, but could be any Node) to expose action information. */ server cluster Actions = 37 { - enum ActionErrorEnum : ENUM8 { + enum ActionErrorEnum : enum8 { kUnknown = 0; kInterrupted = 1; } - enum ActionStateEnum : ENUM8 { + enum ActionStateEnum : enum8 { kInactive = 0; kActive = 1; kPaused = 2; kDisabled = 3; } - enum ActionTypeEnum : ENUM8 { + enum ActionTypeEnum : enum8 { kOther = 0; kScene = 1; kSequence = 2; @@ -696,13 +696,13 @@ server cluster Actions = 37 { kAlarm = 6; } - enum EndpointListTypeEnum : ENUM8 { + enum EndpointListTypeEnum : enum8 { kOther = 0; kRoom = 1; kZone = 2; } - bitmap CommandBits : BITMAP16 { + bitmap CommandBits : bitmap16 { kInstantAction = 0x1; kInstantActionWithTransition = 0x2; kStartAction = 0x4; @@ -761,7 +761,7 @@ server cluster Actions = 37 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -785,7 +785,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -849,20 +849,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -923,13 +923,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -937,7 +937,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -1001,7 +1001,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1016,7 +1016,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -1031,12 +1031,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -1056,13 +1056,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -1077,7 +1077,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a Device's power system. */ server cluster PowerSourceConfiguration = 46 { - readonly attribute int8u sources[] = 0; + readonly attribute endpoint_no sources[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1088,7 +1088,7 @@ server cluster PowerSourceConfiguration = 46 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -1124,7 +1124,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -1138,20 +1138,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -1235,38 +1235,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1320,7 +1320,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1328,7 +1328,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1384,7 +1384,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1400,7 +1400,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1409,13 +1409,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1569,13 +1577,13 @@ client cluster DiagnosticLogs = 50 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1583,7 +1591,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1613,7 +1621,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1623,7 +1631,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1637,7 +1645,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1645,14 +1653,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1718,8 +1726,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1747,24 +1755,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1774,7 +1782,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1915,19 +1923,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1936,7 +1944,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1946,7 +1954,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1989,7 +1997,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -2002,7 +2010,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2023,12 +2031,12 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */ server cluster TimeSynchronization = 56 { - enum GranularityEnum : ENUM8 { + enum GranularityEnum : enum8 { kNoTimeGranularity = 0; kMinutesGranularity = 1; kSecondsGranularity = 2; @@ -2036,11 +2044,11 @@ server cluster TimeSynchronization = 56 { kMicrosecondsGranularity = 4; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kTimeNotAccepted = 2; } - enum TimeSourceEnum : ENUM8 { + enum TimeSourceEnum : enum8 { kNone = 0; kUnknown = 1; kAdmin = 2; @@ -2060,13 +2068,13 @@ server cluster TimeSynchronization = 56 { kGNSS = 16; } - enum TimeZoneDatabaseEnum : ENUM8 { + enum TimeZoneDatabaseEnum : enum8 { kFull = 0; kPartial = 1; kNone = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTimeZone = 0x1; kNTPClient = 0x2; kNTPServer = 0x4; @@ -2170,7 +2178,7 @@ server cluster TimeSynchronization = 56 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2220,21 +2228,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2247,7 +2259,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -2261,12 +2273,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -2308,7 +2320,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -2316,14 +2328,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -2346,12 +2358,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -2362,7 +2374,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -2377,12 +2389,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -2497,8 +2509,30 @@ server cluster BooleanState = 69 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; } fabric_scoped struct MonitoringRegistrationStruct { @@ -2507,8 +2541,8 @@ server cluster IcdManagement = 70 { fabric_idx fabricIndex = 254; } - readonly attribute int32u idleModeInterval = 0; - readonly attribute int32u activeModeInterval = 1; + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; readonly attribute int16u activeModeThreshold = 2; readonly attribute access(read: administer) MonitoringRegistrationStruct registeredClients[] = 3; readonly attribute access(read: administer) int32u ICDCounter = 4; @@ -2543,7 +2577,7 @@ server cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2581,14 +2615,14 @@ server cluster ModeSelect = 80 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster LaundryWasherMode = 81 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kNormal = 16384; kDelicate = 16385; kHeavy = 16386; kWhites = 16387; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2628,12 +2662,12 @@ server cluster LaundryWasherMode = 81 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kRapidCool = 16384; kRapidFreeze = 16385; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2673,14 +2707,14 @@ server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { /** This cluster supports remotely monitoring and controling the different typs of functionality available to a washing device, such as a washing machine. */ server cluster LaundryWasherControls = 83 { - enum NumberOfRinsesEnum : ENUM8 { + enum NumberOfRinsesEnum : enum8 { kNone = 0; kNormal = 1; kExtra = 2; kMax = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSpin = 0x1; kRinse = 0x2; } @@ -2699,12 +2733,12 @@ server cluster LaundryWasherControls = 83 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcRunMode = 84 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kIdle = 16384; kCleaning = 16385; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kStuck = 65; kDustBinMissing = 66; kDustBinFull = 67; @@ -2715,7 +2749,7 @@ server cluster RvcRunMode = 84 { kBatteryLow = 72; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2732,7 +2766,6 @@ server cluster RvcRunMode = 84 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute nullable int8u startUpMode = 2; attribute nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2755,17 +2788,17 @@ server cluster RvcRunMode = 84 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcCleanMode = 85 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kDeepClean = 16384; kVacuum = 16385; kMop = 16386; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kCleaningInProgress = 64; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2782,7 +2815,6 @@ server cluster RvcCleanMode = 85 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute nullable int8u startUpMode = 2; attribute nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -2805,7 +2837,7 @@ server cluster RvcCleanMode = 85 { /** Attributes and commands for configuring the temperature control, and reporting temperature. */ server cluster TemperatureControl = 86 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureNumber = 0x1; kTemperatureLevel = 0x2; kTemperatureStep = 0x4; @@ -2830,7 +2862,7 @@ server cluster TemperatureControl = 86 { /** Attributes and commands for configuring the Refrigerator alarm. */ server cluster RefrigeratorAlarm = 87 { - bitmap AlarmMap : BITMAP32 { + bitmap AlarmMap : bitmap32 { kDoorOpen = 0x1; } @@ -2854,13 +2886,13 @@ server cluster RefrigeratorAlarm = 87 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster DishwasherMode = 89 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kNormal = 16384; kHeavy = 16385; kLight = 16386; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2900,7 +2932,7 @@ server cluster DishwasherMode = 89 { /** Attributes for reporting air quality classification */ server cluster AirQuality = 91 { - enum AirQualityEnum : ENUM8 { + enum AirQualityEnum : enum8 { kUnknown = 0; kGood = 1; kFair = 2; @@ -2910,7 +2942,7 @@ server cluster AirQuality = 91 { kExtremelyPoor = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kFair = 0x1; kModerate = 0x2; kVeryPoor = 0x4; @@ -2928,25 +2960,25 @@ server cluster AirQuality = 91 { /** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */ server cluster SmokeCoAlarm = 92 { - enum AlarmStateEnum : ENUM8 { + enum AlarmStateEnum : enum8 { kNormal = 0; kWarning = 1; kCritical = 2; } - enum ContaminationStateEnum : ENUM8 { + enum ContaminationStateEnum : enum8 { kNormal = 0; kLow = 1; kWarning = 2; kCritical = 3; } - enum EndOfServiceEnum : ENUM8 { + enum EndOfServiceEnum : enum8 { kNormal = 0; kExpired = 1; } - enum ExpressedStateEnum : ENUM8 { + enum ExpressedStateEnum : enum8 { kNormal = 0; kSmokeAlarm = 1; kCOAlarm = 2; @@ -2958,18 +2990,18 @@ server cluster SmokeCoAlarm = 92 { kInterconnectCO = 8; } - enum MuteStateEnum : ENUM8 { + enum MuteStateEnum : enum8 { kNotMuted = 0; kMuted = 1; } - enum SensitivityEnum : ENUM8 { + enum SensitivityEnum : enum8 { kHigh = 0; kStandard = 1; kLow = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSmokeAlarm = 0x1; kCOAlarm = 0x2; } @@ -3023,7 +3055,7 @@ server cluster SmokeCoAlarm = 92 { readonly attribute AlarmStateEnum interconnectSmokeAlarm = 8; readonly attribute AlarmStateEnum interconnectCOAlarm = 9; readonly attribute ContaminationStateEnum contaminationState = 10; - attribute SensitivityEnum smokeSensitivityLevel = 11; + attribute access(write: manage) SensitivityEnum smokeSensitivityLevel = 11; readonly attribute epoch_s expiryDate = 12; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -3037,7 +3069,7 @@ server cluster SmokeCoAlarm = 92 { /** Attributes and commands for configuring the Dishwasher alarm. */ server cluster DishwasherAlarm = 93 { - bitmap AlarmMap : BITMAP32 { + bitmap AlarmMap : bitmap32 { kInflowError = 0x1; kDrainError = 0x2; kDoorError = 0x4; @@ -3046,7 +3078,7 @@ server cluster DishwasherAlarm = 93 { kWaterLevelError = 0x20; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kReset = 0x1; } @@ -3082,14 +3114,14 @@ server cluster DishwasherAlarm = 93 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ server cluster OperationalState = 96 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kNoError = 0; kUnableToStartOrResume = 1; kUnableToCompleteOperation = 2; kCommandInvalidInState = 3; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kStopped = 0; kRunning = 1; kPaused = 2; @@ -3142,7 +3174,7 @@ server cluster OperationalState = 96 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ server cluster RvcOperationalState = 97 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kFailedToFindChargingDock = 64; kStuck = 65; kDustBinMissing = 66; @@ -3153,7 +3185,7 @@ server cluster RvcOperationalState = 97 { kMopCleaningPadMissing = 71; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kSeekingCharger = 64; kCharging = 65; kDocked = 66; @@ -3203,18 +3235,18 @@ server cluster RvcOperationalState = 97 { /** Attributes and commands for monitoring HEPA filters in a device */ server cluster HepaFilterMonitoring = 113 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -3222,7 +3254,7 @@ server cluster HepaFilterMonitoring = 113 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -3251,18 +3283,18 @@ server cluster HepaFilterMonitoring = 113 { /** Attributes and commands for monitoring activated carbon filters in a device */ server cluster ActivatedCarbonFilterMonitoring = 114 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -3270,7 +3302,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -3297,552 +3329,9 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { command ResetCondition(): DefaultSuccess = 0; } -/** An interface to a generic way to secure a door */ -server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { - kLockJammed = 0; - kLockFactoryReset = 1; - kLockRadioPowerCycled = 3; - kWrongCodeEntryLimit = 4; - kFrontEsceutcheonRemoved = 5; - kDoorForcedOpen = 6; - kDoorAjar = 7; - kForcedUser = 8; - } - - enum CredentialRuleEnum : ENUM8 { - kSingle = 0; - kDual = 1; - kTri = 2; - } - - enum CredentialTypeEnum : ENUM8 { - kProgrammingPIN = 0; - kPIN = 1; - kRFID = 2; - kFingerprint = 3; - kFingerVein = 4; - kFace = 5; - } - - enum DataOperationTypeEnum : ENUM8 { - kAdd = 0; - kClear = 1; - kModify = 2; - } - - enum DlLockState : ENUM8 { - kNotFullyLocked = 0; - kLocked = 1; - kUnlocked = 2; - kUnlatched = 3; - } - - enum DlLockType : ENUM8 { - kDeadBolt = 0; - kMagnetic = 1; - kOther = 2; - kMortise = 3; - kRim = 4; - kLatchBolt = 5; - kCylindricalLock = 6; - kTubularLock = 7; - kInterconnectedLock = 8; - kDeadLatch = 9; - kDoorFurniture = 10; - kEurocylinder = 11; - } - - enum DlStatus : ENUM8 { - kSuccess = 0; - kFailure = 1; - kDuplicate = 2; - kOccupied = 3; - kInvalidField = 133; - kResourceExhausted = 137; - kNotFound = 139; - } - - enum DoorLockOperationEventCode : ENUM8 { - kUnknownOrMfgSpecific = 0; - kLock = 1; - kUnlock = 2; - kLockInvalidPinOrId = 3; - kLockInvalidSchedule = 4; - kUnlockInvalidPinOrId = 5; - kUnlockInvalidSchedule = 6; - kOneTouchLock = 7; - kKeyLock = 8; - kKeyUnlock = 9; - kAutoLock = 10; - kScheduleLock = 11; - kScheduleUnlock = 12; - kManualLock = 13; - kManualUnlock = 14; - } - - enum DoorLockProgrammingEventCode : ENUM8 { - kUnknownOrMfgSpecific = 0; - kMasterCodeChanged = 1; - kPinAdded = 2; - kPinDeleted = 3; - kPinChanged = 4; - kIdAdded = 5; - kIdDeleted = 6; - } - - enum DoorLockSetPinOrIdStatus : ENUM8 { - kSuccess = 0; - kGeneralFailure = 1; - kMemoryFull = 2; - kDuplicateCodeError = 3; - } - - enum DoorLockUserStatus : ENUM8 { - kAvailable = 0; - kOccupiedEnabled = 1; - kOccupiedDisabled = 3; - kNotSupported = 255; - } - - enum DoorLockUserType : ENUM8 { - kUnrestricted = 0; - kYearDayScheduleUser = 1; - kWeekDayScheduleUser = 2; - kMasterUser = 3; - kNonAccessUser = 4; - kNotSupported = 255; - } - - enum DoorStateEnum : ENUM8 { - kDoorOpen = 0; - kDoorClosed = 1; - kDoorJammed = 2; - kDoorForcedOpen = 3; - kDoorUnspecifiedError = 4; - kDoorAjar = 5; - } - - enum LockDataTypeEnum : ENUM8 { - kUnspecified = 0; - kProgrammingCode = 1; - kUserIndex = 2; - kWeekDaySchedule = 3; - kYearDaySchedule = 4; - kHolidaySchedule = 5; - kPIN = 6; - kRFID = 7; - kFingerprint = 8; - kFingerVein = 9; - kFace = 10; - } - - enum LockOperationTypeEnum : ENUM8 { - kLock = 0; - kUnlock = 1; - kNonAccessUserEvent = 2; - kForcedUserEvent = 3; - kUnlatch = 4; - } - - enum OperatingModeEnum : ENUM8 { - kNormal = 0; - kVacation = 1; - kPrivacy = 2; - kNoRemoteLockUnlock = 3; - kPassage = 4; - } - - enum OperationErrorEnum : ENUM8 { - kUnspecified = 0; - kInvalidCredential = 1; - kDisabledUserDenied = 2; - kRestricted = 3; - kInsufficientBattery = 4; - } - - enum OperationSourceEnum : ENUM8 { - kUnspecified = 0; - kManual = 1; - kProprietaryRemote = 2; - kKeypad = 3; - kAuto = 4; - kButton = 5; - kSchedule = 6; - kRemote = 7; - kRFID = 8; - kBiometric = 9; - } - - enum UserStatusEnum : ENUM8 { - kAvailable = 0; - kOccupiedEnabled = 1; - kOccupiedDisabled = 3; - } - - enum UserTypeEnum : ENUM8 { - kUnrestrictedUser = 0; - kYearDayScheduleUser = 1; - kWeekDayScheduleUser = 2; - kProgrammingUser = 3; - kNonAccessUser = 4; - kForcedUser = 5; - kDisposableUser = 6; - kExpiringUser = 7; - kScheduleRestrictedUser = 8; - kRemoteOnlyUser = 9; - } - - bitmap DaysMaskMap : BITMAP8 { - kSunday = 0x1; - kMonday = 0x2; - kTuesday = 0x4; - kWednesday = 0x8; - kThursday = 0x10; - kFriday = 0x20; - kSaturday = 0x40; - } - - bitmap DlCredentialRuleMask : BITMAP8 { - kSingle = 0x1; - kDual = 0x2; - kTri = 0x4; - } - - bitmap DlCredentialRulesSupport : BITMAP8 { - kSingle = 0x1; - kDual = 0x2; - kTri = 0x4; - } - - bitmap DlDefaultConfigurationRegister : BITMAP16 { - kEnableLocalProgrammingEnabled = 0x1; - kKeypadInterfaceDefaultAccessEnabled = 0x2; - kRemoteInterfaceDefaultAccessIsEnabled = 0x4; - kSoundEnabled = 0x20; - kAutoRelockTimeSet = 0x40; - kLEDSettingsSet = 0x80; - } - - bitmap DlKeypadOperationEventMask : BITMAP16 { - kUnknown = 0x1; - kLock = 0x2; - kUnlock = 0x4; - kLockInvalidPIN = 0x8; - kLockInvalidSchedule = 0x10; - kUnlockInvalidCode = 0x20; - kUnlockInvalidSchedule = 0x40; - kNonAccessUserOpEvent = 0x80; - } - - bitmap DlKeypadProgrammingEventMask : BITMAP16 { - kUnknown = 0x1; - kProgrammingPINChanged = 0x2; - kPINAdded = 0x4; - kPINCleared = 0x8; - kPINChanged = 0x10; - } - - bitmap DlLocalProgrammingFeatures : BITMAP8 { - kAddUsersCredentialsSchedulesLocally = 0x1; - kModifyUsersCredentialsSchedulesLocally = 0x2; - kClearUsersCredentialsSchedulesLocally = 0x4; - kAdjustLockSettingsLocally = 0x8; - } - - bitmap DlManualOperationEventMask : BITMAP16 { - kUnknown = 0x1; - kThumbturnLock = 0x2; - kThumbturnUnlock = 0x4; - kOneTouchLock = 0x8; - kKeyLock = 0x10; - kKeyUnlock = 0x20; - kAutoLock = 0x40; - kScheduleLock = 0x80; - kScheduleUnlock = 0x100; - kManualLock = 0x200; - kManualUnlock = 0x400; - } - - bitmap DlRFIDOperationEventMask : BITMAP16 { - kUnknown = 0x1; - kLock = 0x2; - kUnlock = 0x4; - kLockInvalidRFID = 0x8; - kLockInvalidSchedule = 0x10; - kUnlockInvalidRFID = 0x20; - kUnlockInvalidSchedule = 0x40; - } - - bitmap DlRFIDProgrammingEventMask : BITMAP16 { - kUnknown = 0x1; - kRFIDCodeAdded = 0x20; - kRFIDCodeCleared = 0x40; - } - - bitmap DlRemoteOperationEventMask : BITMAP16 { - kUnknown = 0x1; - kLock = 0x2; - kUnlock = 0x4; - kLockInvalidCode = 0x8; - kLockInvalidSchedule = 0x10; - kUnlockInvalidCode = 0x20; - kUnlockInvalidSchedule = 0x40; - } - - bitmap DlRemoteProgrammingEventMask : BITMAP16 { - kUnknown = 0x1; - kProgrammingPINChanged = 0x2; - kPINAdded = 0x4; - kPINCleared = 0x8; - kPINChanged = 0x10; - kRFIDCodeAdded = 0x20; - kRFIDCodeCleared = 0x40; - } - - bitmap DlSupportedOperatingModes : BITMAP16 { - kNormal = 0x1; - kVacation = 0x2; - kPrivacy = 0x4; - kNoRemoteLockUnlock = 0x8; - kPassage = 0x10; - } - - bitmap DoorLockDayOfWeek : BITMAP8 { - kSunday = 0x1; - kMonday = 0x2; - kTuesday = 0x4; - kWednesday = 0x8; - kThursday = 0x10; - kFriday = 0x20; - kSaturday = 0x40; - } - - bitmap Feature : BITMAP32 { - kPINCredential = 0x1; - kRFIDCredential = 0x2; - kFingerCredentials = 0x4; - kLogging = 0x8; - kWeekDayAccessSchedules = 0x10; - kDoorPositionSensor = 0x20; - kFaceCredentials = 0x40; - kCredentialsOverTheAirAccess = 0x80; - kUser = 0x100; - kNotification = 0x200; - kYearDayAccessSchedules = 0x400; - kHolidaySchedules = 0x800; - kUnbolt = 0x1000; - } - - struct CredentialStruct { - CredentialTypeEnum credentialType = 0; - int16u credentialIndex = 1; - } - - critical event DoorLockAlarm = 0 { - AlarmCodeEnum alarmCode = 0; - } - - critical event DoorStateChange = 1 { - DoorStateEnum doorState = 0; - } - - critical event LockOperation = 2 { - LockOperationTypeEnum lockOperationType = 0; - OperationSourceEnum operationSource = 1; - nullable int16u userIndex = 2; - nullable fabric_idx fabricIndex = 3; - nullable node_id sourceNode = 4; - optional nullable CredentialStruct credentials[] = 5; - } - - critical event LockOperationError = 3 { - LockOperationTypeEnum lockOperationType = 0; - OperationSourceEnum operationSource = 1; - OperationErrorEnum operationError = 2; - nullable int16u userIndex = 3; - nullable fabric_idx fabricIndex = 4; - nullable node_id sourceNode = 5; - optional nullable CredentialStruct credentials[] = 6; - } - - info event LockUserChange = 4 { - LockDataTypeEnum lockDataType = 0; - DataOperationTypeEnum dataOperationType = 1; - OperationSourceEnum operationSource = 2; - nullable int16u userIndex = 3; - nullable fabric_idx fabricIndex = 4; - nullable node_id sourceNode = 5; - nullable int16u dataIndex = 6; - } - - readonly attribute nullable DlLockState lockState = 0; - readonly attribute DlLockType lockType = 1; - readonly attribute boolean actuatorEnabled = 2; - readonly attribute nullable DoorStateEnum doorState = 3; - attribute access(write: manage) int32u doorOpenEvents = 4; - attribute access(write: manage) int32u doorClosedEvents = 5; - attribute access(write: manage) int16u openPeriod = 6; - readonly attribute int16u numberOfTotalUsersSupported = 17; - readonly attribute int16u numberOfPINUsersSupported = 18; - readonly attribute int16u numberOfRFIDUsersSupported = 19; - readonly attribute int8u numberOfWeekDaySchedulesSupportedPerUser = 20; - readonly attribute int8u maxPINCodeLength = 23; - readonly attribute int8u minPINCodeLength = 24; - readonly attribute int8u maxRFIDCodeLength = 25; - readonly attribute int8u minRFIDCodeLength = 26; - readonly attribute DlCredentialRuleMask credentialRulesSupport = 27; - readonly attribute int8u numberOfCredentialsSupportedPerUser = 28; - attribute access(write: manage) char_string<3> language = 33; - attribute access(write: manage) int32u autoRelockTime = 35; - attribute access(write: manage) int8u soundVolume = 36; - attribute access(write: manage) OperatingModeEnum operatingMode = 37; - readonly attribute DlSupportedOperatingModes supportedOperatingModes = 38; - readonly attribute DlDefaultConfigurationRegister defaultConfigurationRegister = 39; - attribute access(write: manage) boolean enableOneTouchLocking = 41; - attribute access(write: manage) boolean enableInsideStatusLED = 42; - attribute access(write: manage) boolean enablePrivacyModeButton = 43; - attribute access(write: administer) int8u wrongCodeEntryLimit = 48; - attribute access(write: administer) int8u userCodeTemporaryDisableTime = 49; - attribute access(write: administer) boolean requirePINforRemoteOperation = 51; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct LockDoorRequest { - optional octet_string PINCode = 0; - } - - request struct UnlockDoorRequest { - optional octet_string PINCode = 0; - } - - request struct UnlockWithTimeoutRequest { - int16u timeout = 0; - optional octet_string PINCode = 1; - } - - request struct SetWeekDayScheduleRequest { - int8u weekDayIndex = 0; - int16u userIndex = 1; - DaysMaskMap daysMask = 2; - int8u startHour = 3; - int8u startMinute = 4; - int8u endHour = 5; - int8u endMinute = 6; - } - - request struct GetWeekDayScheduleRequest { - int8u weekDayIndex = 0; - int16u userIndex = 1; - } - - request struct ClearWeekDayScheduleRequest { - int8u weekDayIndex = 0; - int16u userIndex = 1; - } - - request struct SetYearDayScheduleRequest { - int8u yearDayIndex = 0; - int16u userIndex = 1; - epoch_s localStartTime = 2; - epoch_s localEndTime = 3; - } - - request struct GetYearDayScheduleRequest { - int8u yearDayIndex = 0; - int16u userIndex = 1; - } - - request struct SetUserRequest { - DataOperationTypeEnum operationType = 0; - int16u userIndex = 1; - nullable char_string userName = 2; - nullable int32u userUniqueID = 3; - nullable UserStatusEnum userStatus = 4; - nullable UserTypeEnum userType = 5; - nullable CredentialRuleEnum credentialRule = 6; - } - - request struct GetUserRequest { - int16u userIndex = 0; - } - - request struct ClearUserRequest { - int16u userIndex = 0; - } - - request struct SetCredentialRequest { - DataOperationTypeEnum operationType = 0; - CredentialStruct credential = 1; - LONG_OCTET_STRING credentialData = 2; - nullable int16u userIndex = 3; - nullable UserStatusEnum userStatus = 4; - nullable UserTypeEnum userType = 5; - } - - request struct GetCredentialStatusRequest { - CredentialStruct credential = 0; - } - - request struct ClearCredentialRequest { - nullable CredentialStruct credential = 0; - } - - request struct UnboltDoorRequest { - optional octet_string PINCode = 0; - } - - response struct GetUserResponse = 28 { - int16u userIndex = 0; - nullable char_string userName = 1; - nullable int32u userUniqueID = 2; - nullable UserStatusEnum userStatus = 3; - nullable UserTypeEnum userType = 4; - nullable CredentialRuleEnum credentialRule = 5; - nullable CredentialStruct credentials[] = 6; - nullable fabric_idx creatorFabricIndex = 7; - nullable fabric_idx lastModifiedFabricIndex = 8; - nullable int16u nextUserIndex = 9; - } - - response struct SetCredentialResponse = 35 { - DlStatus status = 0; - nullable int16u userIndex = 1; - nullable int16u nextCredentialIndex = 2; - } - - response struct GetCredentialStatusResponse = 37 { - boolean credentialExists = 0; - nullable int16u userIndex = 1; - nullable fabric_idx creatorFabricIndex = 2; - nullable fabric_idx lastModifiedFabricIndex = 3; - nullable int16u nextCredentialIndex = 4; - } - - timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; - timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1; - timed command UnlockWithTimeout(UnlockWithTimeoutRequest): DefaultSuccess = 3; - command access(invoke: administer) SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11; - command access(invoke: administer) GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12; - command access(invoke: administer) ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13; - command access(invoke: administer) SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14; - command access(invoke: administer) GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15; - timed command access(invoke: administer) SetUser(SetUserRequest): DefaultSuccess = 26; - command access(invoke: administer) GetUser(GetUserRequest): GetUserResponse = 27; - timed command access(invoke: administer) ClearUser(ClearUserRequest): DefaultSuccess = 29; - timed command access(invoke: administer) SetCredential(SetCredentialRequest): SetCredentialResponse = 34; - command access(invoke: administer) GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; - timed command access(invoke: administer) ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; - timed command UnboltDoor(UnboltDoorRequest): DefaultSuccess = 39; -} - /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -3870,7 +3359,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -3884,7 +3373,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -3894,7 +3383,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -3902,20 +3391,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; @@ -3986,11 +3475,11 @@ server cluster WindowCovering = 258 { /** This cluster provides control of a barrier (garage door). */ server cluster BarrierControl = 259 { - bitmap BarrierControlCapabilities : BITMAP8 { + bitmap BarrierControlCapabilities : bitmap8 { kPartialBarrier = 0x1; } - bitmap BarrierControlSafetyStatus : BITMAP16 { + bitmap BarrierControlSafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTemperDetected = 0x2; kFailedCommunication = 0x4; @@ -4018,7 +3507,7 @@ server cluster BarrierControl = 259 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -4027,14 +3516,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -4044,9 +3533,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -4140,13 +3629,13 @@ server cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -4155,13 +3644,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -4173,7 +3662,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -4184,7 +3673,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4194,7 +3683,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -4236,12 +3725,12 @@ server cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -4251,7 +3740,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -4260,12 +3749,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -4274,13 +3763,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } @@ -4328,53 +3817,53 @@ server cluster ThermostatUserInterfaceConfiguration = 516 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -4382,14 +3871,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -4627,29 +4116,29 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring a lighting ballast. */ provisional server cluster BallastConfiguration = 769 { - bitmap BallastStatusBitmap : BITMAP8 { + bitmap BallastStatusBitmap : bitmap8 { kBallastNonOperational = 0x1; kLampFailure = 0x2; } - bitmap LampAlarmModeBitmap : BITMAP8 { + bitmap LampAlarmModeBitmap : bitmap8 { kLampBurnHours = 0x1; } readonly attribute int8u physicalMinLevel = 0; readonly attribute int8u physicalMaxLevel = 1; readonly attribute BallastStatusBitmap ballastStatus = 2; - attribute int8u minLevel = 16; - attribute int8u maxLevel = 17; - attribute nullable int8u intrinsicBallastFactor = 20; - attribute nullable int8u ballastFactorAdjustment = 21; + attribute access(write: manage) int8u minLevel = 16; + attribute access(write: manage) int8u maxLevel = 17; + attribute access(write: manage) nullable int8u intrinsicBallastFactor = 20; + attribute access(write: manage) nullable int8u ballastFactorAdjustment = 21; readonly attribute int8u lampQuantity = 32; - attribute char_string<16> lampType = 48; - attribute char_string<16> lampManufacturer = 49; - attribute nullable int24u lampRatedHours = 50; - attribute nullable int24u lampBurnHours = 51; - attribute LampAlarmModeBitmap lampAlarmMode = 52; - attribute nullable int24u lampBurnHoursTripPoint = 53; + attribute access(write: manage) char_string<16> lampType = 48; + attribute access(write: manage) char_string<16> lampManufacturer = 49; + attribute access(write: manage) nullable int24u lampRatedHours = 50; + attribute access(write: manage) nullable int24u lampBurnHours = 51; + attribute access(write: manage) LampAlarmModeBitmap lampAlarmMode = 52; + attribute access(write: manage) nullable int24u lampBurnHoursTripPoint = 53; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4660,7 +4149,7 @@ provisional server cluster BallastConfiguration = 769 { /** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */ server cluster IlluminanceMeasurement = 1024 { - enum LightSensorTypeEnum : ENUM8 { + enum LightSensorTypeEnum : enum8 { kPhotodiode = 0; kCMOS = 1; } @@ -4680,10 +4169,10 @@ server cluster IlluminanceMeasurement = 1024 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4694,7 +4183,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -4739,18 +4228,18 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; @@ -4769,7 +4258,7 @@ server cluster OccupancySensing = 1030 { /** Attributes for reporting carbon monoxide concentration measurements */ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -4777,13 +4266,13 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -4794,7 +4283,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -4824,7 +4313,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { /** Attributes for reporting carbon dioxide concentration measurements */ server cluster CarbonDioxideConcentrationMeasurement = 1037 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -4832,13 +4321,13 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -4849,7 +4338,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -4879,7 +4368,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { /** Attributes for reporting nitrogen dioxide concentration measurements */ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -4887,13 +4376,13 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -4904,7 +4393,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -4934,7 +4423,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { /** Attributes for reporting ozone concentration measurements */ server cluster OzoneConcentrationMeasurement = 1045 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -4942,13 +4431,13 @@ server cluster OzoneConcentrationMeasurement = 1045 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -4959,7 +4448,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -4989,7 +4478,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { /** Attributes for reporting PM2.5 concentration measurements */ server cluster Pm25ConcentrationMeasurement = 1066 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -4997,13 +4486,13 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5014,7 +4503,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5044,7 +4533,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { /** Attributes for reporting formaldehyde concentration measurements */ server cluster FormaldehydeConcentrationMeasurement = 1067 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -5052,13 +4541,13 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5069,7 +4558,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5099,7 +4588,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { /** Attributes for reporting PM1 concentration measurements */ server cluster Pm1ConcentrationMeasurement = 1068 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -5107,13 +4596,13 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5124,7 +4613,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5154,7 +4643,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { /** Attributes for reporting PM10 concentration measurements */ server cluster Pm10ConcentrationMeasurement = 1069 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -5162,13 +4651,13 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5179,7 +4668,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5209,7 +4698,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { /** Attributes for reporting total volatile organic compounds concentration measurements */ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -5217,13 +4706,13 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5234,7 +4723,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5264,7 +4753,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { /** Attributes for reporting radon concentration measurements */ server cluster RadonConcentrationMeasurement = 1071 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -5272,13 +4761,13 @@ server cluster RadonConcentrationMeasurement = 1071 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -5289,7 +4778,7 @@ server cluster RadonConcentrationMeasurement = 1071 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -5363,42 +4852,42 @@ server cluster ElectricalMeasurement = 2820 { /** The Test Cluster is meant to validate the generated code */ internal server cluster UnitTesting = 4294048773 { - enum SimpleEnum : ENUM8 { + enum SimpleEnum : enum8 { kUnspecified = 0; kValueA = 1; kValueB = 2; kValueC = 3; } - bitmap Bitmap16MaskMap : BITMAP16 { + bitmap Bitmap16MaskMap : bitmap16 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x4000; } - bitmap Bitmap32MaskMap : BITMAP32 { + bitmap Bitmap32MaskMap : bitmap32 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x40000000; } - bitmap Bitmap64MaskMap : BITMAP64 { + bitmap Bitmap64MaskMap : bitmap64 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x4000000000000000; } - bitmap Bitmap8MaskMap : BITMAP8 { + bitmap Bitmap8MaskMap : bitmap8 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x40; } - bitmap SimpleBitmap : BITMAP8 { + bitmap SimpleBitmap : bitmap8 { kValueA = 0x1; kValueB = 0x2; kValueC = 0x4; @@ -5685,7 +5174,7 @@ internal server cluster UnitTesting = 4294048773 { /** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */ internal server cluster FaultInjection = 4294048774 { - enum FaultType : ENUM8 { + enum FaultType : enum8 { kUnspecified = 0; kSystemFault = 1; kInetFault = 2; @@ -6203,8 +5692,8 @@ endpoint 0 { } server cluster IcdManagement { - callback attribute idleModeInterval default = 500; - callback attribute activeModeInterval default = 300; + callback attribute idleModeDuration default = 500; + callback attribute activeModeDuration default = 300; callback attribute activeModeThreshold default = 300; callback attribute registeredClients; callback attribute ICDCounter default = 0; @@ -6213,7 +5702,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 1; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command RegisterClient; handle command RegisterClientResponse; @@ -6294,7 +5783,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; @@ -6479,7 +5968,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -6494,7 +5983,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -6516,13 +6005,12 @@ endpoint 1 { server cluster RvcRunMode { callback attribute supportedModes; callback attribute currentMode; - callback attribute startUpMode; callback attribute onMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -6531,13 +6019,12 @@ endpoint 1 { server cluster RvcCleanMode { callback attribute supportedModes; callback attribute currentMode; - callback attribute startUpMode; callback attribute onMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -6576,7 +6063,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -6712,63 +6199,6 @@ endpoint 1 { handle command ResetCondition; } - server cluster DoorLock { - emits event DoorLockAlarm; - emits event LockOperation; - emits event LockOperationError; - emits event LockUserChange; - ram attribute lockState default = 2; - ram attribute lockType; - ram attribute actuatorEnabled; - ram attribute doorState; - ram attribute doorOpenEvents; - ram attribute doorClosedEvents; - ram attribute openPeriod; - ram attribute numberOfTotalUsersSupported default = 10; - ram attribute numberOfPINUsersSupported default = 10; - ram attribute numberOfRFIDUsersSupported default = 10; - ram attribute numberOfWeekDaySchedulesSupportedPerUser default = 10; - ram attribute maxPINCodeLength default = 6; - ram attribute minPINCodeLength default = 6; - ram attribute maxRFIDCodeLength default = 20; - ram attribute minRFIDCodeLength default = 10; - ram attribute credentialRulesSupport default = 1; - ram attribute numberOfCredentialsSupportedPerUser default = 5; - ram attribute language default = "en"; - ram attribute autoRelockTime default = 60; - ram attribute soundVolume default = 0x00; - ram attribute operatingMode default = 0x00; - ram attribute supportedOperatingModes default = 0xFFF6; - ram attribute defaultConfigurationRegister default = 0; - ram attribute enableOneTouchLocking default = 0x00; - ram attribute enableInsideStatusLED default = 0; - ram attribute enablePrivacyModeButton default = 0x00; - ram attribute wrongCodeEntryLimit default = 3; - ram attribute userCodeTemporaryDisableTime default = 10; - ram attribute requirePINforRemoteOperation default = 0; - ram attribute featureMap default = 0x11B3; - ram attribute clusterRevision default = 6; - - handle command LockDoor; - handle command UnlockDoor; - handle command UnlockWithTimeout; - handle command SetWeekDaySchedule; - handle command GetWeekDaySchedule; - handle command ClearWeekDaySchedule; - handle command SetYearDaySchedule; - handle command GetYearDaySchedule; - handle command SetUser; - handle command GetUser; - handle command GetUserResponse; - handle command ClearUser; - handle command SetCredential; - handle command SetCredentialResponse; - handle command GetCredentialStatus; - handle command GetCredentialStatusResponse; - handle command ClearCredential; - handle command UnboltDoor; - } - server cluster WindowCovering { ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; @@ -7437,7 +6867,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; @@ -7521,7 +6951,7 @@ endpoint 2 { } } endpoint 65534 { - device type ma_secondary_network_commissioning = 61442, version 1; + device type ma_secondary_network_commissioning = 4293984258, version 1; server cluster Descriptor { @@ -7529,6 +6959,10 @@ endpoint 65534 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; callback attribute clusterRevision default = 2; } @@ -7542,6 +6976,10 @@ endpoint 65534 { callback attribute lastNetworkingStatus; callback attribute lastNetworkID; callback attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap default = 0; callback 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 011fd91f522250..2ed3d542d5c751 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 @@ -5206,7 +5206,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5994,7 +5994,7 @@ ], "attributes": [ { - "name": "IdleModeInterval", + "name": "IdleModeDuration", "code": 0, "mfgCode": null, "side": "server", @@ -6010,7 +6010,7 @@ "reportableChange": 0 }, { - "name": "ActiveModeInterval", + "name": "ActiveModeDuration", "code": 1, "mfgCode": null, "side": "server", @@ -6163,7 +6163,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -7132,7 +7132,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9150,7 +9150,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9322,7 +9322,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9558,22 +9558,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "OnMode", "code": 3, @@ -9664,7 +9648,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9730,22 +9714,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "OnMode", "code": 3, @@ -9836,7 +9804,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10287,7 +10255,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11609,696 +11577,44 @@ "attributes": [ { "name": "Condition", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "percent", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "DegradationDirection", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "DegradationDirectionEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ChangeIndication", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "ChangeIndicationEnum", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "InPlaceIndicator", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "LastChangedTime", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "epoch_s", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ReplacementProductList", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Door Lock", - "code": 257, - "mfgCode": null, - "define": "DOOR_LOCK_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "LockDoor", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "UnlockDoor", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "UnlockWithTimeout", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SetWeekDaySchedule", - "code": 11, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetWeekDaySchedule", - "code": 12, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "ClearWeekDaySchedule", - "code": 13, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SetYearDaySchedule", - "code": 14, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetYearDaySchedule", - "code": 15, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SetUser", - "code": 26, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetUser", - "code": 27, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetUserResponse", - "code": 28, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "ClearUser", - "code": 29, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SetCredential", - "code": 34, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "SetCredentialResponse", - "code": 35, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "GetCredentialStatus", - "code": 36, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetCredentialStatusResponse", - "code": 37, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "ClearCredential", - "code": 38, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "UnboltDoor", - "code": 39, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "LockState", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "DlLockState", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LockType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "DlLockType", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ActuatorEnabled", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DoorState", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "DoorStateEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "DoorOpenEvents", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "DoorClosedEvents", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OpenPeriod", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfTotalUsersSupported", - "code": 17, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfPINUsersSupported", - "code": 18, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfRFIDUsersSupported", - "code": 19, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfWeekDaySchedulesSupportedPerUser", - "code": 20, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxPINCodeLength", - "code": 23, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinPINCodeLength", - "code": 24, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxRFIDCodeLength", - "code": 25, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "20", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinRFIDCodeLength", - "code": 26, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "10", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CredentialRulesSupport", - "code": 27, - "mfgCode": null, - "side": "server", - "type": "DlCredentialRuleMask", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfCredentialsSupportedPerUser", - "code": 28, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "Language", - "code": 33, - "mfgCode": null, - "side": "server", - "type": "char_string", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "en", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "AutoRelockTime", - "code": 35, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "60", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoundVolume", - "code": 36, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "OperatingMode", - "code": 37, + "code": 0, "mfgCode": null, "side": "server", - "type": "OperatingModeEnum", + "type": "percent", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SupportedOperatingModes", - "code": 38, + "name": "DegradationDirection", + "code": 1, "mfgCode": null, "side": "server", - "type": "DlSupportedOperatingModes", + "type": "DegradationDirectionEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFF6", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "DefaultConfigurationRegister", - "code": 39, + "name": "ChangeIndication", + "code": 2, "mfgCode": null, "side": "server", - "type": "DlDefaultConfigurationRegister", + "type": "ChangeIndicationEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12308,96 +11624,96 @@ "reportableChange": 0 }, { - "name": "EnableOneTouchLocking", - "code": 41, + "name": "InPlaceIndicator", + "code": 3, "mfgCode": null, "side": "server", "type": "boolean", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "EnableInsideStatusLED", - "code": 42, + "name": "LastChangedTime", + "code": 4, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "epoch_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "EnablePrivacyModeButton", - "code": 43, + "name": "ReplacementProductList", + "code": 5, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "WrongCodeEntryLimit", - "code": 48, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "UserCodeTemporaryDisableTime", - "code": 49, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "10", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "RequirePINforRemoteOperation", - "code": 51, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "boolean", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12410,10 +11726,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x11B3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12429,42 +11745,12 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "6", + "defaultValue": "1", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 } - ], - "events": [ - { - "name": "DoorLockAlarm", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "LockOperation", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "LockOperationError", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "LockUserChange", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1 - } ] }, { @@ -21438,7 +20724,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22198,14 +21484,14 @@ "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" }, "deviceTypes": [ { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" @@ -22215,10 +21501,10 @@ 1 ], "deviceIdentifiers": [ - 61442 + 4293984258 ], "deviceTypeName": "MA-secondary-network-commissioning", - "deviceTypeCode": 61442, + "deviceTypeCode": 4293984258, "deviceTypeProfileId": 259, "clusters": [ { @@ -22293,6 +21579,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -22537,6 +21887,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index a6c1684b997e50..ab7f1a5726765f 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -27,11 +27,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 - Setup build environment: diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index f105d3efe41a44..07052e123757cd 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -154,10 +154,12 @@ list( APPEND ${list_chip_main_sources} ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp @@ -167,10 +169,15 @@ list( ${chip_dir}/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/Globals.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/LEDWidget.cpp + ${chip_dir}/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp + ${chip_dir}/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp + ${chip_dir}/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_hook.c ${chip_dir}/examples/platform/ameba/route_hook/ameba_route_table.c + ${chip_dir}/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.cpp + ${chip_dir}/examples/providers/DeviceInfoProviderImpl.cpp ) @@ -263,6 +270,7 @@ list( -DMBEDTLS_CONFIG_FILE= -DCHIP_SHELL_MAX_TOKENS=11 -DCONFIG_ENABLE_AMEBA_FACTORY_DATA=0 + -DCONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER=0 ) if (matter_enable_persistentstorage_audit) diff --git a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp index 50e6d11db53c25..7b178060a6fff2 100644 --- a/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp @@ -93,6 +93,12 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) exit: return err; } + +void CHIPDeviceManager::Shutdown() +{ + PlatformMgr().Shutdown(); +} + } // namespace DeviceManager } // namespace chip diff --git a/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp b/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp new file mode 100644 index 00000000000000..feb346b892f6bb --- /dev/null +++ b/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp @@ -0,0 +1,159 @@ +/* + * + * Copyright (c) 2022 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 "ManualOperationCommand.h" +#include "ManualDishWasherAlarmCommand.h" +#include "ManualOperationalStateCommand.h" +#include "ManualRVCModesCommand.h" +#include "ManualRefrigeratorAlarmCommand.h" + +#include "app/server/Server.h" +#include "platform/CHIPDeviceLayer.h" +#include + +#if CONFIG_ENABLE_CHIP_SHELL +#include "lib/shell/Engine.h" +#include "lib/shell/commands/Help.h" +#endif // ENABLE_CHIP_SHELL + +using namespace chip; +using namespace chip::app; + +#if CONFIG_ENABLE_CHIP_SHELL +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +Engine sShellManualOperationSubCommands; +#endif // defined(ENABLE_CHIP_SHELL) + +namespace { +#if CONFIG_ENABLE_CHIP_SHELL + +/******************************************************** + * Manual Operation shell functions + *********************************************************/ + +CHIP_ERROR ManualOperationHelpHandler(int argc, char ** argv) +{ + sShellManualOperationSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualOperationCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualOperationHelpHandler(argc, argv); + } + + return sShellManualOperationSubCommands.ExecCommand(argc, argv); +} + +/** + * @brief configures switch matter shell + * + */ +static void RegisterManualOperationCommands() +{ + + static const shell_command_t sManualOperationSubCommands[] = { + { &ManualOperationHelpHandler, "help", "Usage: manual " }, + { &ManualOperationalStateCommandHandler, "opstate", " Usage: manual opstate " }, + { &ManualRVCCommandHandler, "rvc", " Usage: manual rvc " }, + { &ManualRefrigeratorAlarmCommandHandler, "refalm", " Usage: manual refalm " }, + { &ManualDishWasherAlarmCommandHandler, "dishalm", " Usage: manual dishalm " }, + }; + + static const shell_command_t sManualOperationalStateSubCommands[] = { + { &ManualOperationalStateCommandHelpHandler, "help", "Usage: manual opstate " }, + { &ManualOperationalStateSetStateCommandHandler, "set-state", "set-state Usage: manual opstate set-state " }, + { &ManualOperationalStateSetErrorCommandHandler, "set-error", "set-error Usage: manual opstate set-error " }, + }; + + static const shell_command_t sManualRVCSubCommands[] = { + { &ManualRVCCommandHelpHandler, "help", "Usage: manual rvc " }, + { &ManualRVCOperationalStateCommandHandler, "opstate", "Usage: manual rvc opstate " }, + { &ManualRVCRunModeCommandHandler, "runmode", "Usage: manual rvc runmode " }, + { &ManualRVCCleanModeCommandHandler, "cleanmode", "Usage: manual rvc cleanmode " }, + }; + + static const shell_command_t sManualRVCOperationalStateSubCommands[] = { + { &ManualRVCOperationalStateCommandHelpHandler, "help", "Usage: manual rvc opstate " }, + { &ManualRVCOperationalStateSetStateCommandHandler, "set-state", "set-state Usage: manual rvc opstate set-state " }, + { &ManualRVCOperationalStateSetErrorCommandHandler, "set-error", "set-error Usage: manual rvc opstate set-error " }, + }; + + static const shell_command_t sManualRVCRunModeSubCommands[] = { + { &ManualRVCRunModeCommandHelpHandler, "help", "Usage: manual rvc runmode " }, + { &ManualRVCRunModeSetModeCommandHandler, "set-mode", "set-mode Usage: manual rvc runmode set-mode " }, + }; + + static const shell_command_t sManualRVCCleanModeSubCommands[] = { + { &ManualRVCCleanModeCommandHelpHandler, "help", "Usage: manual rvc cleanmode " }, + { &ManualRVCCleanModeSetModeCommandHandler, "set-mode", "set-mode Usage: manual rvc cleanmode set-mode " }, + }; + + static const shell_command_t sManualRefrigeratorAlarmStateSubCommands[] = { + { &ManualRefrigeratorAlarmCommandHelpHandler, "help", "Usage: manual refalm " }, + { &ManualRefrigeratorAlarmDoorOpenCommandHandler, "door-open", "door-open Usage: manual refalm door-open" }, + { &ManualRefrigeratorAlarmDoorCloseCommandHandler, "door-close", "door-close Usage: manual refalm door-close" }, + { &ManualRefrigeratorAlarmSuppressCommandHandler, "suppress-alarm", "suppress-alarm Usage: manual refalm suppress-alarm" }, + }; + + static const shell_command_t sManualDishWasherAlarmSubCommands[] = { + { &ManualDishWasherAlarmCommandHelpHandler, "help", "Usage: manual dishalm " }, + { &ManualDishWasherAlarmSetRaiseCommandHandler, "raise", "raise Usage: manual dishalm raise" }, + { &ManualDishWasherAlarmSetLowerCommandHandler, "lower", "lower Usage: manual dishalm lower" }, + }; + + static const shell_command_t sManualOperationCommand = { &ManualOperationCommandHandler, "manual", + "Manual Operation commands. Usage: manual " }; + + // Register commands + sShellManualOperationSubCommands.RegisterCommands(sManualOperationSubCommands, ArraySize(sManualOperationSubCommands)); + sShellManualOperationalStateSubCommands.RegisterCommands(sManualOperationalStateSubCommands, + ArraySize(sManualOperationalStateSubCommands)); + sShellManualRVCSubCommands.RegisterCommands(sManualRVCSubCommands, ArraySize(sManualRVCSubCommands)); + sShellManualRVCOperationalStateSubCommands.RegisterCommands(sManualRVCOperationalStateSubCommands, + ArraySize(sManualRVCOperationalStateSubCommands)); + sShellManualRVCRunModeSubCommands.RegisterCommands(sManualRVCRunModeSubCommands, ArraySize(sManualRVCRunModeSubCommands)); + sShellManualRVCCleanModeSubCommands.RegisterCommands(sManualRVCCleanModeSubCommands, ArraySize(sManualRVCCleanModeSubCommands)); + sShellManualRefrigeratorAlarmStateSubCommands.RegisterCommands(sManualRefrigeratorAlarmStateSubCommands, + ArraySize(sManualRefrigeratorAlarmStateSubCommands)); + sShellManualDishWasherAlarmStateSubCommands.RegisterCommands(sManualDishWasherAlarmSubCommands, + ArraySize(sManualDishWasherAlarmSubCommands)); + + Engine::Root().RegisterCommands(&sManualOperationCommand, 1); +} +#endif // ENABLE_CHIP_SHELL + +} // namespace + +/******************************************************** + * Switch functions + *********************************************************/ + +CHIP_ERROR InitManualOperation() +{ +#if CONFIG_ENABLE_CHIP_SHELL + RegisterManualOperationCommands(); +#endif + return CHIP_NO_ERROR; +} diff --git a/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp b/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp new file mode 100644 index 00000000000000..9e4001e7d24e2d --- /dev/null +++ b/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp @@ -0,0 +1,173 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::RvcOperationalState; + +CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) +{ + if (index >= mOperationalStateList.size()) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalState = mOperationalStateList[index]; + return CHIP_NO_ERROR; +} + +CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_t index, GenericOperationalPhase & operationalPhase) +{ + if (index >= mOperationalPhaseList.size()) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalPhase = mOperationalPhaseList[index]; + return CHIP_NO_ERROR; +} + +void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +// Init Operational State cluster + +static OperationalState::Instance * gOperationalStateInstance = nullptr; +static OperationalStateDelegate * gOperationalStateDelegate = nullptr; + +void OperationalState::Shutdown() +{ + if (gOperationalStateInstance != nullptr) + { + delete gOperationalStateInstance; + gOperationalStateInstance = nullptr; + } + if (gOperationalStateDelegate != nullptr) + { + delete gOperationalStateDelegate; + gOperationalStateDelegate = nullptr; + } +} + +OperationalState::Instance * OperationalState::GetOperationalStateInstance() +{ + return gOperationalStateInstance; +} + +void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gOperationalStateInstance == nullptr && gOperationalStateDelegate == nullptr); + + gOperationalStateDelegate = new OperationalStateDelegate; + EndpointId operationalStateEndpoint = 0x01; + gOperationalStateInstance = new Instance(gOperationalStateDelegate, operationalStateEndpoint, Clusters::OperationalState::Id); + + gOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + gOperationalStateInstance->Init(); +} + +// Init RVC Operational State cluster + +static OperationalState::Instance * gRvcOperationalStateInstance = nullptr; +static RvcOperationalStateDelegate * gRvcOperationalStateDelegate = nullptr; + +OperationalState::Instance * OperationalState::GetRVCOperationalStateInstance() +{ + return gRvcOperationalStateInstance; +} + +void RvcOperationalState::Shutdown() +{ + if (gRvcOperationalStateInstance != nullptr) + { + delete gRvcOperationalStateInstance; + gRvcOperationalStateInstance = nullptr; + } + if (gRvcOperationalStateDelegate != nullptr) + { + delete gRvcOperationalStateDelegate; + gRvcOperationalStateDelegate = nullptr; + } +} + +void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gRvcOperationalStateInstance == nullptr && gRvcOperationalStateDelegate == nullptr); + + gRvcOperationalStateDelegate = new RvcOperationalStateDelegate; + EndpointId operationalStateEndpoint = 0x01; + gRvcOperationalStateInstance = + new Instance(gRvcOperationalStateDelegate, operationalStateEndpoint, Clusters::RvcOperationalState::Id); + + gRvcOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + gRvcOperationalStateInstance->Init(); +} diff --git a/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp b/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp new file mode 100644 index 00000000000000..bede2bcf537a76 --- /dev/null +++ b/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp @@ -0,0 +1,171 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SmokeCOAlarmManager.h" +#include +#include + +using namespace chip; +using namespace chip::app::Clusters::SmokeCoAlarm; +using namespace chip::DeviceLayer; + +static std::array sPriorityOrder = { + ExpressedStateEnum::kSmokeAlarm, ExpressedStateEnum::kInterconnectSmoke, ExpressedStateEnum::kCOAlarm, + ExpressedStateEnum::kInterconnectCO, ExpressedStateEnum::kHardwareFault, ExpressedStateEnum::kTesting, + ExpressedStateEnum::kEndOfService, ExpressedStateEnum::kBatteryAlert +}; + +CHIP_ERROR SmokeCoAlarmManager::Init() +{ + return CHIP_NO_ERROR; +} + +void SmokeCoAlarmManager::StartSelfTesting() +{ + // Currently selftest is not implemented +} + +bool emberAfHandleEventTrigger(uint64_t eventTrigger) +{ + SmokeCOTrigger trigger = static_cast(eventTrigger); + + switch (trigger) + { + case SmokeCOTrigger::kForceSmokeCritical: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke (critical)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kCritical), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceSmokeWarning: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke (warning)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kWarning), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceSmokeInterconnect: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke interconnect (warning)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectSmokeAlarm(1, AlarmStateEnum::kWarning), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceCOCritical: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (critical)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kCritical), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceCOWarning: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (warning)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kWarning), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceCOInterconnect: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (warning)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectCOAlarm(1, AlarmStateEnum::kWarning), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceSmokeContaminationHigh: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke contamination (critical)"); + SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kCritical); + break; + case SmokeCOTrigger::kForceSmokeContaminationLow: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke contamination (warning)"); + SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kLow); + break; + case SmokeCOTrigger::kForceSmokeSensitivityHigh: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke sensistivity (high)"); + SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kHigh); + break; + case SmokeCOTrigger::kForceSmokeSensitivityLow: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke sensitivity (low)"); + SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kLow); + break; + case SmokeCOTrigger::kForceMalfunction: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force malfunction"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetHardwareFaultAlert(1, true), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceLowBatteryWarning: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force low battery (warning)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kWarning), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceLowBatteryCritical: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force low battery (critical)"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kCritical), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceEndOfLife: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force end-of-life"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetEndOfServiceAlert(1, EndOfServiceEnum::kExpired), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kForceSilence: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force silence"); + SmokeCoAlarmServer::Instance().SetDeviceMuted(1, MuteStateEnum::kMuted); + break; + case SmokeCOTrigger::kClearSmoke: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear smoke"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearCO: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear CO"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearSmokeInterconnect: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear smoke interconnect"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectSmokeAlarm(1, AlarmStateEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearCOInterconnect: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear CO interconnect"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectCOAlarm(1, AlarmStateEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearMalfunction: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear malfunction"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetHardwareFaultAlert(1, false), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearEndOfLife: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear end-of-life"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetEndOfServiceAlert(1, EndOfServiceEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearSilence: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear silence"); + SmokeCoAlarmServer::Instance().SetDeviceMuted(1, MuteStateEnum::kNotMuted); + break; + case SmokeCOTrigger::kClearBatteryLevelLow: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear low battery"); + VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kNormal), true); + SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder); + break; + case SmokeCOTrigger::kClearContamination: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force SmokeContamination (warning)"); + SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kNormal); + break; + case SmokeCOTrigger::kClearSensitivity: + ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear Smoke Sensitivity"); + SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kStandard); + break; + default: + + return false; + } + + return true; +} diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index ac3426f4b438cc..21280c676154be 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -22,15 +22,18 @@ #include "DeviceCallbacks.h" #include "Globals.h" #include "LEDWidget.h" +#include "ManualOperationCommand.h" #include "chip_porting.h" #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -39,6 +42,9 @@ #include #include #include +#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER +#include +#endif #if CONFIG_ENABLE_PW_RPC #include @@ -123,11 +129,23 @@ Identify gIdentify1 = { static DeviceCallbacks EchoCallbacks; chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; +#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +#endif + static void InitServer(intptr_t context) { // Init ZCL Data Model and CHIP App Server static chip::CommonCaseDeviceServerInitParams initParams; + +#if CONFIG_ENABLE_AMEBA_TEST_EVENT_TRIGGER + static AmebaTestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; + initParams.testEventTriggerDelegate = &testEventTriggerDelegate; +#endif + initParams.InitializeStaticResourcesBeforeServerInit(); + chip::Server::GetInstance().Init(initParams); gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage()); // TODO: Use our own DeviceInfoProvider @@ -143,6 +161,7 @@ static void InitServer(intptr_t context) #if CONFIG_ENABLE_CHIP_SHELL InitBindingHandler(); + InitManualOperation(); #endif app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } @@ -175,7 +194,20 @@ extern "C" void ChipTest(void) #endif } +extern "C" void ChipTestShutdown(void) +{ + ChipLogProgress(DeviceLayer, "All Clusters Demo! Shutdown Now!"); + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + deviceMgr.Shutdown(); +} + bool lowPowerClusterSleep() { return true; } + +using namespace chip::app::Clusters::LaundryWasherControls; +void emberAfLaundryWasherControlsClusterInitCallback(EndpointId endpoint) +{ + LaundryWasherControlsServer::SetDefaultDelegate(endpoint, &LaundryWasherControlDelegate::getLaundryWasherControlDelegate()); +} diff --git a/examples/all-clusters-app/ameba/main/include/CHIPDeviceManager.h b/examples/all-clusters-app/ameba/main/include/CHIPDeviceManager.h index 4ceddc65e7085e..03588bee0d02c6 100644 --- a/examples/all-clusters-app/ameba/main/include/CHIPDeviceManager.h +++ b/examples/all-clusters-app/ameba/main/include/CHIPDeviceManager.h @@ -103,6 +103,8 @@ class DLL_EXPORT CHIPDeviceManager */ CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + void Shutdown(); + /** * @brief * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. diff --git a/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h b/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h new file mode 100644 index 00000000000000..c1a37be41d385a --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/ManualDishWasherAlarmCommand.h @@ -0,0 +1,172 @@ +/* + * + * Copyright (c) 2022 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 "controller/InvokeInteraction.h" +#include "controller/ReadInteraction.h" +#include + +#if CONFIG_ENABLE_CHIP_SHELL +#include "lib/shell/Engine.h" +#include "lib/shell/commands/Help.h" +#endif // ENABLE_CHIP_SHELL + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DishwasherAlarm; + +#if CONFIG_ENABLE_CHIP_SHELL +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +Engine sShellManualDishWasherAlarmStateSubCommands; +#endif // defined(ENABLE_CHIP_SHELL) + +#if CONFIG_ENABLE_CHIP_SHELL + +CHIP_ERROR ManualDishWasherAlarmCommandHelpHandler(int argc, char ** argv) +{ + sShellManualDishWasherAlarmStateSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualDishWasherAlarmCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualDishWasherAlarmCommandHelpHandler(argc, argv); + } + + return sShellManualDishWasherAlarmStateSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualDishWasherAlarmSetRaiseCommandHandler(int argc, char ** argv) +{ + if (argc != 0) + { + return ManualDishWasherAlarmCommandHelpHandler(argc, argv); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + EmberAfStatus status; + DishwasherAlarmServer & serverInstance = DishwasherAlarmServer::Instance(); + + BitMask supported; // Set dishwasher alarm supported value + supported.SetField(AlarmMap::kInflowError, 1); // 0x01, 1 + supported.SetField(AlarmMap::kDrainError, 1); // 0x02, 2 + supported.SetField(AlarmMap::kDoorError, 1); // 0x04, 4 + supported.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8 + supported.SetField(AlarmMap::kWaterLevelError, 1); // 0x20, 32 + + BitMask mask; // Set dishwasher alarm mask value + mask.SetField(AlarmMap::kInflowError, 1); // 0x01, 1 + mask.SetField(AlarmMap::kDrainError, 1); // 0x02, 2 + mask.SetField(AlarmMap::kDoorError, 1); // 0x04, 4 + mask.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8 + mask.SetField(AlarmMap::kWaterLevelError, 1); // 0x20, 32 + + BitMask state; // Set dishwasher alarm state value + state.SetField(AlarmMap::kDrainError, 1); // 0x02, 2 + state.SetField(AlarmMap::kDoorError, 1); // 0x04, 4 + state.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8 + + status = serverInstance.SetSupportedValue(1, supported); // 0x2F, 47 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetMaskValue(1, mask); // 0x2F, 47 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetStateValue(1, state); // 0x0E, 14 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualDishWasherAlarmSetRaiseCommandHandler Failed!\r\n"); + } + + return err; +} + +CHIP_ERROR ManualDishWasherAlarmSetLowerCommandHandler(int argc, char ** argv) +{ + if (argc != 0) + { + return ManualDishWasherAlarmCommandHelpHandler(argc, argv); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + EmberAfStatus status; + DishwasherAlarmServer & serverInstance = DishwasherAlarmServer::Instance(); + + BitMask supported; // Set dishwasher alarm supported value + supported.SetField(AlarmMap::kInflowError, 1); // 0x01, 1 + supported.SetField(AlarmMap::kDrainError, 1); // 0x02, 2 + supported.SetField(AlarmMap::kDoorError, 1); // 0x04, 4 + supported.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8 + supported.SetField(AlarmMap::kWaterLevelError, 1); // 0x20, 32 + + BitMask mask; // Set dishwasher alarm mask value + mask.SetField(AlarmMap::kInflowError, 1); // 0x01, 1 + mask.SetField(AlarmMap::kDrainError, 1); // 0x02, 2 + mask.SetField(AlarmMap::kDoorError, 1); // 0x04, 4 + mask.SetField(AlarmMap::kTempTooLow, 1); // 0x08, 8 + mask.SetField(AlarmMap::kWaterLevelError, 1); // 0x20, 32 + + status = serverInstance.SetSupportedValue(1, supported); // 0x2F, 47 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetMaskValue(1, mask); // 0x2F, 47 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetStateValue(1, 0); // Set dishwasher alarm state value 0x00, 0 + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualDishWasherAlarmSetLowerCommandHandler Failed!\r\n"); + } + + return err; +} +#endif // CONFIG_ENABLE_CHIP_SHELL diff --git a/examples/all-clusters-app/ameba/main/include/ManualOperationCommand.h b/examples/all-clusters-app/ameba/main/include/ManualOperationCommand.h new file mode 100644 index 00000000000000..418d0aea6f498e --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/ManualOperationCommand.h @@ -0,0 +1,26 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "app-common/zap-generated/ids/Attributes.h" +#include "app-common/zap-generated/ids/Clusters.h" +#include "app-common/zap-generated/ids/Commands.h" +#include "lib/core/CHIPError.h" + +CHIP_ERROR InitManualOperation(); diff --git a/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h b/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h new file mode 100644 index 00000000000000..1f6d899b59e828 --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h @@ -0,0 +1,185 @@ +/* + * + * Copyright (c) 2022 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 "controller/InvokeInteraction.h" +#include "controller/ReadInteraction.h" +#include + +#if CONFIG_ENABLE_CHIP_SHELL +#include "lib/shell/Engine.h" +#include "lib/shell/commands/Help.h" +#endif // ENABLE_CHIP_SHELL + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; + +#if CONFIG_ENABLE_CHIP_SHELL +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +Engine sShellManualOperationalStateSubCommands; +Engine sShellManualRVCOperationalStateSubCommands; +#endif // defined(ENABLE_CHIP_SHELL) + +#if CONFIG_ENABLE_CHIP_SHELL +/******************************************************** + * Operational State Functions + *********************************************************/ + +CHIP_ERROR ManualOperationalStateCommandHelpHandler(int argc, char ** argv) +{ + sShellManualOperationalStateSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualOperationalStateCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualOperationalStateCommandHelpHandler(argc, argv); + } + + return sShellManualOperationalStateSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualOperationalStateSetStateCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualOperationalStateCommandHelpHandler(argc, argv); + } + uint32_t state = atoi(argv[0]); + + CHIP_ERROR err; + err = GetOperationalStateInstance()->SetOperationalState(state); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualOperationalStateSetStateCommandHandler Failed!\r\n"); + } + + return err; +} + +CHIP_ERROR ManualOperationalStateSetErrorCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualOperationalStateCommandHelpHandler(argc, argv); + } + + GenericOperationalError err(to_underlying(ErrorStateEnum::kNoError)); + uint32_t error = atoi(argv[0]); + + switch (error) + { + case to_underlying(OperationalState::ErrorStateEnum::kNoError): // 0x00, 0 + case to_underlying(OperationalState::ErrorStateEnum::kUnableToStartOrResume): // 0x01, 1 + case to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation): // 0x02, 2 + case to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState): // 0x03, 3 + err.errorStateID = error; + break; + default: + err.errorStateID = to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue); // 0x04, 4 + break; + } + + GetOperationalStateInstance()->OnOperationalErrorDetected(err); + + return CHIP_NO_ERROR; +} + +/******************************************************** + * RVC Operational State Functions + *********************************************************/ + +CHIP_ERROR ManualRVCOperationalStateCommandHelpHandler(int argc, char ** argv) +{ + sShellManualRVCOperationalStateSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualRVCOperationalStateCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualRVCOperationalStateCommandHelpHandler(argc, argv); + } + + return sShellManualRVCOperationalStateSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualRVCOperationalStateSetStateCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualRVCOperationalStateCommandHelpHandler(argc, argv); + } + uint32_t state = atoi(argv[0]); + + CHIP_ERROR err; + err = GetRVCOperationalStateInstance()->SetOperationalState(state); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualRVCOperationalStateSetStateCommandHandler Failed!\r\n"); + } + + return err; +} + +CHIP_ERROR ManualRVCOperationalStateSetErrorCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualRVCOperationalStateCommandHelpHandler(argc, argv); + } + + GenericOperationalError err(to_underlying(ErrorStateEnum::kNoError)); + uint32_t error = atoi(argv[0]); + + switch (error) + { + case to_underlying(OperationalState::ErrorStateEnum::kNoError): // 0x00, 0 + case to_underlying(OperationalState::ErrorStateEnum::kUnableToStartOrResume): // 0x01, 1 + case to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation): // 0x02, 2 + case to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState): // 0x03, 3 + case to_underlying(RvcOperationalState::ErrorStateEnum::kFailedToFindChargingDock): // 0x40, 64 + case to_underlying(RvcOperationalState::ErrorStateEnum::kStuck): // 0x41, 65 + case to_underlying(RvcOperationalState::ErrorStateEnum::kDustBinMissing): // 0x42, 66 + case to_underlying(RvcOperationalState::ErrorStateEnum::kDustBinFull): // 0x43, 67 + case to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankEmpty): // 0x44, 68 + case to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankMissing): // 0x45, 69 + case to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankLidOpen): // 0x46, 70 + case to_underlying(RvcOperationalState::ErrorStateEnum::kMopCleaningPadMissing): // 0x47, 71 + err.errorStateID = error; + break; + default: + err.errorStateID = to_underlying(OperationalState::ErrorStateEnum::kUnknownEnumValue); // 0x04, 4 + break; + } + + GetRVCOperationalStateInstance()->OnOperationalErrorDetected(err); + + return CHIP_NO_ERROR; +} +#endif // CONFIG_ENABLE_CHIP_SHELL diff --git a/examples/all-clusters-app/ameba/main/include/ManualRVCModesCommand.h b/examples/all-clusters-app/ameba/main/include/ManualRVCModesCommand.h new file mode 100644 index 00000000000000..b020141c5df7a9 --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/ManualRVCModesCommand.h @@ -0,0 +1,135 @@ +/* + * + * Copyright (c) 2022 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 "controller/InvokeInteraction.h" +#include "controller/ReadInteraction.h" +#include + +#if CONFIG_ENABLE_CHIP_SHELL +#include "lib/shell/Engine.h" +#include "lib/shell/commands/Help.h" +#endif // ENABLE_CHIP_SHELL + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +#if CONFIG_ENABLE_CHIP_SHELL +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +Engine sShellManualRVCSubCommands; +Engine sShellManualRVCRunModeSubCommands; +Engine sShellManualRVCCleanModeSubCommands; +#endif // defined(ENABLE_CHIP_SHELL) + +#if CONFIG_ENABLE_CHIP_SHELL +/******************************************************** + * RVC + *********************************************************/ + +CHIP_ERROR ManualRVCCommandHelpHandler(int argc, char ** argv) +{ + sShellManualRVCSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualRVCCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualRVCCommandHelpHandler(argc, argv); + } + return sShellManualRVCSubCommands.ExecCommand(argc, argv); +} + +/******************************************************** + * RVC Run Mode + *********************************************************/ + +CHIP_ERROR ManualRVCRunModeCommandHelpHandler(int argc, char ** argv) +{ + sShellManualRVCRunModeSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualRVCRunModeCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualRVCRunModeCommandHelpHandler(argc, argv); + } + + return sShellManualRVCRunModeSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualRVCRunModeSetModeCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualRVCRunModeCommandHelpHandler(argc, argv); + } + Protocols::InteractionModel::Status status; + status = RvcRunMode::Instance()->UpdateCurrentMode((uint8_t) atoi(argv[0])); + if (status != Protocols::InteractionModel::Status::Success) + { + ChipLogError(DeviceLayer, "ManualRVCRunModeSetModeCommandHandler Error!"); + return CHIP_ERROR_INTERNAL; + } + return CHIP_NO_ERROR; +} + +/******************************************************** + * RVC Clean Mode + *********************************************************/ + +CHIP_ERROR ManualRVCCleanModeCommandHelpHandler(int argc, char ** argv) +{ + sShellManualRVCCleanModeSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualRVCCleanModeCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualRVCCleanModeCommandHelpHandler(argc, argv); + } + + return sShellManualRVCCleanModeSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualRVCCleanModeSetModeCommandHandler(int argc, char ** argv) +{ + if (argc != 1) + { + return ManualRVCCleanModeCommandHelpHandler(argc, argv); + } + Protocols::InteractionModel::Status status; + status = RvcCleanMode::Instance()->UpdateCurrentMode((uint8_t) atoi(argv[0])); + if (status != Protocols::InteractionModel::Status::Success) + { + ChipLogError(DeviceLayer, "ManualRVCCleanModeSetModeCommandHandler Error!"); + return CHIP_ERROR_INTERNAL; + } + return CHIP_NO_ERROR; +} + +#endif // CONFIG_ENABLE_CHIP_SHELL diff --git a/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h b/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h new file mode 100644 index 00000000000000..d2ec4224a5332f --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/ManualRefrigeratorAlarmCommand.h @@ -0,0 +1,160 @@ +/* + * + * Copyright (c) 2022 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 "controller/InvokeInteraction.h" +#include "controller/ReadInteraction.h" +#include + +#if CONFIG_ENABLE_CHIP_SHELL +#include "lib/shell/Engine.h" +#include "lib/shell/commands/Help.h" +#endif // ENABLE_CHIP_SHELL + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RefrigeratorAlarm; + +#if CONFIG_ENABLE_CHIP_SHELL +using Shell::Engine; +using Shell::shell_command_t; +using Shell::streamer_get; +using Shell::streamer_printf; + +Engine sShellManualRefrigeratorAlarmStateSubCommands; +#endif // defined(ENABLE_CHIP_SHELL) + +#if CONFIG_ENABLE_CHIP_SHELL + +CHIP_ERROR ManualRefrigeratorAlarmCommandHelpHandler(int argc, char ** argv) +{ + sShellManualRefrigeratorAlarmStateSubCommands.ForEachCommand(Shell::PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; +} + +CHIP_ERROR ManualRefrigeratorAlarmCommandHandler(int argc, char ** argv) +{ + if (argc == 0) + { + return ManualRefrigeratorAlarmCommandHelpHandler(argc, argv); + } + + return sShellManualRefrigeratorAlarmStateSubCommands.ExecCommand(argc, argv); +} + +CHIP_ERROR ManualRefrigeratorAlarmDoorOpenCommandHandler(int argc, char ** argv) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EmberAfStatus status; + RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance(); + + status = serverInstance.SetMaskValue(1, 0); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetStateValue(1, 1); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetSupportedValue(1, 0); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualRefrigeratorAlarmDoorOpenCommandHandler Failed!\r\n"); + } + + return err; +} + +CHIP_ERROR ManualRefrigeratorAlarmDoorCloseCommandHandler(int argc, char ** argv) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EmberAfStatus status; + RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance(); + + status = serverInstance.SetMaskValue(1, 1); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetStateValue(1, 0); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetSupportedValue(1, 1); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualRefrigeratorAlarmDoorCloseCommandHandler Failed!\r\n"); + } + + return err; +} + +CHIP_ERROR ManualRefrigeratorAlarmSuppressCommandHandler(int argc, char ** argv) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EmberAfStatus status; + RefrigeratorAlarmServer & serverInstance = RefrigeratorAlarmServer::Instance(); + + status = serverInstance.SetSupportedValue(1, 1); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + + status = serverInstance.SetStateValue(1, 0); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + err = CHIP_ERROR_INTERNAL; + goto exit; + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ManualRefrigeratorAlarmDoorCloseCommandHandler Failed!\r\n"); + } + + return err; +} +#endif // CONFIG_ENABLE_CHIP_SHELL diff --git a/examples/all-clusters-app/ameba/main/include/OperationalStateManager.h b/examples/all-clusters-app/ameba/main/include/OperationalStateManager.h new file mode 100644 index 00000000000000..e98d32171328ac --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/OperationalStateManager.h @@ -0,0 +1,162 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +void getOperationalStateSet(u8 state); + +namespace chip { +namespace app { +namespace Clusters { + +namespace OperationalState { + +Instance * GetOperationalStateInstance(); +Instance * GetRVCOperationalStateInstance(); + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class GenericOperationalStateDelegateImpl : public Delegate +{ +public: + /** + * Get the countdown time. This attribute is not used in this application. + * @return The current countdown time. + */ + app::DataModel::Nullable GetCountdownTime() override { return {}; }; + + /** + * Fills in the provided GenericOperationalState with the state at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * Note: This is used by the SDK to populate the operational state list attribute. If the contents of this list changes, + * the device SHALL call the Instance's ReportOperationalStateListChange method to report that this attribute has changed. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ + CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) override; + + /** + * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the + * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed. + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The GenericOperationalPhase is filled. + */ + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, GenericOperationalPhase & operationalPhase) override; + + // command callback + /** + * Handle Command Callback in application: Pause + * @param[out] get operational error after callback. + */ + void HandlePauseStateCallback(GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Resume + * @param[out] get operational error after callback. + */ + void HandleResumeStateCallback(GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Start + * @param[out] get operational error after callback. + */ + void HandleStartStateCallback(GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Stop + * @param[out] get operational error after callback. + */ + void HandleStopStateCallback(GenericOperationalError & err) override; + +protected: + Span mOperationalStateList; + Span mOperationalPhaseList; +}; + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class OperationalStateDelegate : public GenericOperationalStateDelegateImpl +{ +private: + const GenericOperationalState opStateList[4] = { + GenericOperationalState(to_underlying(OperationalStateEnum::kStopped)), + GenericOperationalState(to_underlying(OperationalStateEnum::kRunning)), + GenericOperationalState(to_underlying(OperationalStateEnum::kPaused)), + GenericOperationalState(to_underlying(OperationalStateEnum::kError)), + }; + + const GenericOperationalPhase opPhaseList[1] = { + // Phase List is null + GenericOperationalPhase(DataModel::Nullable()), + }; + +public: + OperationalStateDelegate() + { + GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList); + GenericOperationalStateDelegateImpl::mOperationalPhaseList = Span(opPhaseList); + } +}; + +void Shutdown(); + +} // namespace OperationalState + +namespace RvcOperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class RvcOperationalStateDelegate : public OperationalState::GenericOperationalStateDelegateImpl +{ +private: + const OperationalState::GenericOperationalState rvcOpStateList[7] = { + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), + OperationalState::GenericOperationalState( + to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), + }; + + const OperationalState::GenericOperationalPhase rvcOpPhaseList[1] = { + // Phase List is null + OperationalState::GenericOperationalPhase(DataModel::Nullable()), + }; + +public: + RvcOperationalStateDelegate() + { + GenericOperationalStateDelegateImpl::mOperationalStateList = + Span(rvcOpStateList); + GenericOperationalStateDelegateImpl::mOperationalPhaseList = + Span(rvcOpPhaseList); + } +}; + +void Shutdown(); + +} // namespace RvcOperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/ameba/main/include/SmokeCOAlarmManager.h b/examples/all-clusters-app/ameba/main/include/SmokeCOAlarmManager.h new file mode 100644 index 00000000000000..390ee679d0d255 --- /dev/null +++ b/examples/all-clusters-app/ameba/main/include/SmokeCOAlarmManager.h @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +bool emberAfHandleEventTrigger(uint64_t eventTrigger); + +class SmokeCoAlarmManager +{ +public: + CHIP_ERROR Init(); + + /** + * @brief Execute the self-test process + * + */ + void StartSelfTesting(); + +private: + friend SmokeCoAlarmManager & AlarmMgr(void); + + static SmokeCoAlarmManager sAlarm; +}; + +inline SmokeCoAlarmManager & AlarmMgr(void) +{ + return SmokeCoAlarmManager::sAlarm; +} diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/README.md b/examples/all-clusters-app/cc13x2x7_26x2x7/README.md index f965d3dd9abbcf..68d6f927224585 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/README.md +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/README.md @@ -68,9 +68,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run - $ chmod +x sysconfig-1.11.0_2225-setup.run - $ ./sysconfig-1.11.0_2225-setup.run + $ wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -97,13 +97,13 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.11.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. ``` $ cd ~/connectedhomeip/examples/all-clusters-app/cc13x2x7_26x2x7 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.11.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` diff --git a/examples/all-clusters-app/cc13x4_26x4/README.md b/examples/all-clusters-app/cc13x4_26x4/README.md index 3415f19f1a4c21..ad8581b52cf26c 100644 --- a/examples/all-clusters-app/cc13x4_26x4/README.md +++ b/examples/all-clusters-app/cc13x4_26x4/README.md @@ -59,9 +59,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -88,7 +88,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -96,7 +96,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/all-clusters-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/all-clusters-minimal-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -105,7 +105,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/all-clusters-app/esp32/main/AppTask.cpp b/examples/all-clusters-app/esp32/main/AppTask.cpp index 0b63316c2d53ac..33b000f6a1baf1 100644 --- a/examples/all-clusters-app/esp32/main/AppTask.cpp +++ b/examples/all-clusters-app/esp32/main/AppTask.cpp @@ -29,7 +29,6 @@ #include "esp_log.h" #include "freertos/FreeRTOS.h" #include -#include #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include "esp_spi_flash.h" @@ -94,12 +93,6 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) // cancel, if required. sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); sAppTask.mFunction = kFunction_FactoryReset; - // Turn off all LEDs before starting blink to make sure blink is - // co-ordinated. - // sStatusLED.Set(false); - // sLockLED.Set(false); - // sStatusLED.Blink(500); - // sLockLED.Blink(500); } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { @@ -135,47 +128,6 @@ void AppTask::StartTimer(uint32_t aTimeoutInMs) } mFunctionTimerActive = true; } -void AppTask::ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor) -{ - // If the action has been initiated by the lock, update the bolt lock trait - // and start flashing the LEDs rapidly to indicate action initiation. - if (aAction == BoltLockManager::LOCK_ACTION) - { - ESP_LOGI(TAG, "Lock Action has been initiated"); - } - else if (aAction == BoltLockManager::UNLOCK_ACTION) - { - ESP_LOGI(TAG, "Unlock Action has been initiated"); - } - if (aActor == AppEvent::kEventType_Button) - { - sAppTask.mSyncClusterToButtonAction = true; - } - // sLockLED.Blink(50, 50); -} -void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) -{ - // if the action has been completed by the lock, update the bolt lock trait. - // Turn on the lock LED if in a LOCKED state OR - // Turn off the lock LED if in an UNLOCKED state. - if (aAction == BoltLockManager::LOCK_ACTION) - { - ESP_LOGI(TAG, "Lock Action has been completed"); - // sLockLED.Set(true); - } - else if (aAction == BoltLockManager::UNLOCK_ACTION) - { - ESP_LOGI(TAG, "Unlock Action has been completed"); - // sLockLED.Set(false); - } -} - -CHIP_ERROR AppTask::LockInit() -{ - ReturnErrorOnFailure(BoltLockMgr().InitLockState()); - BoltLockMgr().SetCallbacks(ActionInitiated, ActionCompleted); - return CHIP_NO_ERROR; -} CHIP_ERROR AppTask::Init() { diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index e3e4d0995d4f34..2687ad0da28539 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -31,7 +31,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/lock" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/mode-support" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd" @@ -72,7 +71,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index cf5a5aa1cb1980..c0caa12cc2eebe 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -343,15 +343,7 @@ class EditAttributeListModel : public TouchesMatterStackModel ESP_LOGI(TAG, "editing attribute as string: '%s' (%s)", value.c_str(), i == 0 ? "+" : "-"); ESP_LOGI(TAG, "name and cluster: '%s' (%s)", name.c_str(), cluster.c_str()); - if (name == "State" && cluster == "Lock") - { - value = (value == "Closed") ? "Open" : "Closed"; - using namespace chip::app::Clusters; - // update the doorlock attribute here - auto attributeValue = value == "Closed" ? DoorLock::DlLockState::kLocked : DoorLock::DlLockState::kUnlocked; - DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, attributeValue); - } - else if (name == "Charge level" && cluster == "Power Source") + if (name == "Charge level" && cluster == "Power Source") { using namespace chip::app::Clusters::PowerSource; auto attributeValue = BatChargeLevelEnum::kOk; @@ -578,13 +570,6 @@ void SetupPretendDevices() // write the temp attribute chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Set(1, static_cast(21 * 100)); - AddDevice("Door Lock"); - AddEndpoint("Default"); - AddCluster("Lock"); - AddAttribute("State", "Open"); - // write the door lock state - chip::app::Clusters::DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, - chip::app::Clusters::DoorLock::DlLockState::kUnlocked); AddDevice("Garage 1"); AddEndpoint("Door 1"); AddCluster("Door"); diff --git a/examples/all-clusters-app/esp32/main/include/AppEvent.h b/examples/all-clusters-app/esp32/main/include/AppEvent.h new file mode 100644 index 00000000000000..26b97ab86d5018 --- /dev/null +++ b/examples/all-clusters-app/esp32/main/include/AppEvent.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "esp_system.h" + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Light, + kEventType_Install, + }; + + uint16_t mType; + + union + { + struct + { + uint8_t mPinNo; + uint8_t mAction; + } mButtonEvent; + struct + { + void * mContext; + } mTimerEvent; + }; + + EventHandler mHandler; +}; diff --git a/examples/all-clusters-app/esp32/main/include/AppTask.h b/examples/all-clusters-app/esp32/main/include/AppTask.h index 779e7e990c12a7..26f8172094ec11 100644 --- a/examples/all-clusters-app/esp32/main/include/AppTask.h +++ b/examples/all-clusters-app/esp32/main/include/AppTask.h @@ -18,8 +18,7 @@ */ #pragma once -#include -#include +#include "AppEvent.h" #include // Application-defined error codes in the CHIP_ERROR space. @@ -39,14 +38,10 @@ class AppTask void PostEvent(const AppEvent * event); void ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction); static void ButtonPressedAction(AppEvent * aEvent); - CHIP_ERROR LockInit(); private: CHIP_ERROR Init(); - static void ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor); - static void ActionCompleted(BoltLockManager::Action_t aAction); - void StartTimer(uint32_t aTimeoutMs); void CancelTimer(void); diff --git a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h index f86bce6c870307..916d1c44496078 100644 --- a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h +++ b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h @@ -32,7 +32,6 @@ #include #include -#include #include #include #include diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 2ea1710ad7ebd5..a90ff6327628fb 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -119,17 +119,12 @@ static void InitServer(intptr_t context) emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); #endif - CHIP_ERROR err = GetAppTask().LockInit(); - if (err != CHIP_NO_ERROR) - { - ESP_LOGE(TAG, "Failed to initialize app task lock, err:%" CHIP_ERROR_FORMAT, err.Format()); - } - #if CONFIG_DEVICE_TYPE_M5STACK SetupPretendDevices(); #endif - err = app::Clusters::ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray( - FIXED_ENDPOINT_COUNT); + CHIP_ERROR err = + app::Clusters::ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray( + FIXED_ENDPOINT_COUNT); if (err != CHIP_NO_ERROR) { ESP_LOGE(TAG, "Failed to initialize endpoint array for supported-modes, err:%" CHIP_ERROR_FORMAT, err.Format()); diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 6e6bb5bcd41378..df6c44d59d9d6c 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -89,7 +89,6 @@ if (is_libfuzzer) { deps = [ ":chip-all-clusters-common", - ":chip-lock-app-common", "${chip_root}/examples/platform/linux:app-main", ] @@ -103,7 +102,6 @@ if (is_libfuzzer) { deps = [ ":chip-all-clusters-common", - ":chip-lock-app-common", "${chip_root}/examples/platform/linux:app-main", ] diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index 03515f36ae24b6..029210cbf28720 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -56,7 +56,6 @@ target_include_directories(app PRIVATE target_sources(app PRIVATE main/AppTask.cpp main/main.cpp - main/ZclDoorLockCallbacks.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/smco-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-temperature-levels.cpp diff --git a/examples/all-clusters-app/nrfconnect/main/include/AppTask.h b/examples/all-clusters-app/nrfconnect/main/include/AppTask.h index 2bd1956dbcf64e..4db18dba683c0e 100644 --- a/examples/all-clusters-app/nrfconnect/main/include/AppTask.h +++ b/examples/all-clusters-app/nrfconnect/main/include/AppTask.h @@ -34,13 +34,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance(void) { static AppTask sAppTask; diff --git a/examples/all-clusters-app/nxp/common/main/AppAssert.cpp b/examples/all-clusters-app/nxp/common/main/AppAssert.cpp new file mode 100644 index 00000000000000..81e028ceadd2f3 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/AppAssert.cpp @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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 "fsl_debug_console.h" +#include + +/* + * Assert function implemented in the application layer. + * This implementation would produce a reset. + * But it could be extended with specific application contrains/requirements. + */ +void __assert_func(const char * file, int line, const char * func, const char * failedExpr) +{ + PRINTF("ASSERT ERROR \" %s \": file \"%s\" Line \"%d\" function name \"%s\" \n", failedExpr, file, line, func); + chip::DeviceLayer::PlatformMgrImpl().Reset(); + while (1) + ; +} diff --git a/examples/all-clusters-app/nxp/common/main/AppFactoryDataDefaultImpl.cpp b/examples/all-clusters-app/nxp/common/main/AppFactoryDataDefaultImpl.cpp new file mode 100644 index 00000000000000..0c28e5029eac99 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/AppFactoryDataDefaultImpl.cpp @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * Copyright 2023 NXP + * 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 "AppFactoryData.h" + +#include +#include +#include + +#if CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA +#include "FactoryDataProvider.h" +/* + * Test key used to encrypt factory data before storing it to the flash. + */ +static const uint8_t aes128TestKey[] + __attribute__((aligned)) = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; +#else +#include +#endif + +using namespace chip; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + +/** + * Allows to register Matter factory data before initializing the Matter stack + * Empty content here nothing particular to do. + */ +CHIP_ERROR AppFactoryData_PreMatterStackInit(void) +{ + return CHIP_NO_ERROR; +} + +/** + * Allows to register Matter factory data before initializing the Matter stack + * Load factory data. + * + * In this example we assume that the matter factory dataset is encrypted. + * This example demonstrates the usage of AES ecb with a software key. + */ +CHIP_ERROR AppFactoryData_PostMatterStackInit(void) +{ + CHIP_ERROR err = CHIP_NO_ERROR; +#if CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA + FactoryDataPrvdImpl().SetEncryptionMode(FactoryDataProvider::encrypt_ecb); + FactoryDataPrvdImpl().SetAes128Key(&aes128TestKey[0]); + + err = FactoryDataPrvdImpl().Init(); + if (err == CHIP_NO_ERROR) + { + SetDeviceInstanceInfoProvider(&FactoryDataPrvd()); + SetDeviceAttestationCredentialsProvider(&FactoryDataPrvd()); + SetCommissionableDataProvider(&FactoryDataPrvd()); + } +#else + // Initialize device attestation with example one (only for debug purpose) + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); +#endif + return err; +} diff --git a/examples/all-clusters-app/nxp/common/main/AppMatterButtonEmpty.cpp b/examples/all-clusters-app/nxp/common/main/AppMatterButtonEmpty.cpp new file mode 100644 index 00000000000000..dfd3eca9eeb105 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/AppMatterButtonEmpty.cpp @@ -0,0 +1,26 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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 "AppMatterButton.h" + +CHIP_ERROR AppMatterButton_registerButtons(void) +{ + /* Empty content could be re-defined in a dedicated platform AppMatterButton_registerButtons function */ + return CHIP_NO_ERROR; +} diff --git a/examples/all-clusters-app/nxp/common/main/AppMatterCli.cpp b/examples/all-clusters-app/nxp/common/main/AppMatterCli.cpp new file mode 100644 index 00000000000000..663bc85920ddb4 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/AppMatterCli.cpp @@ -0,0 +1,137 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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 "AppMatterCli.h" +#include "AppTask.h" +#include +#include +#include + +#ifdef ENABLE_CHIP_SHELL +#include "task.h" +#include +#include + +#define MATTER_CLI_TASK_SIZE ((configSTACK_DEPTH_TYPE) 2048 / sizeof(portSTACK_TYPE)) +#define MATTER_CLI_LOG(message) (streamer_printf(streamer_get(), message)) + +using namespace chip::Shell; +TaskHandle_t AppMatterCliTaskHandle; +static bool isShellInitialized = false; +#else +#define MATTER_CLI_LOG(...) +#endif /* ENABLE_CHIP_SHELL */ + +void AppMatterCliTask(void * args) +{ +#ifdef ENABLE_CHIP_SHELL + Engine::Root().RunMainLoop(); +#endif /* ENABLE_CHIP_SHELL */ +} + +/* Application Matter CLI commands */ + +CHIP_ERROR commissioningManager(int argc, char * argv[]) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + if (strncmp(argv[0], "on", 2) == 0) + { + GetAppTask().StartCommissioningHandler(); + } + else if (strncmp(argv[0], "off", 3) == 0) + { + GetAppTask().StopCommissioningHandler(); + } + else + { + MATTER_CLI_LOG("wrong args should be either \"mattercommissioning on\" or \"mattercommissioning off\""); + error = CHIP_ERROR_INVALID_ARGUMENT; + } + return error; +} + +CHIP_ERROR cliFactoryReset(int argc, char * argv[]) +{ + GetAppTask().FactoryResetHandler(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR cliReset(int argc, char * argv[]) +{ + /* + Shutdown device before reboot, + this emits the ShutDown event, handles the server shutting down, + and stores in flash the total-operational-hours value. + */ + chip::DeviceLayer::PlatformMgr().Shutdown(); + chip::DeviceLayer::PlatformMgrImpl().ScheduleResetInIdle(); + return CHIP_NO_ERROR; +} + +CHIP_ERROR AppMatterCli_RegisterCommands(void) +{ +#ifdef ENABLE_CHIP_SHELL + if (!isShellInitialized) + { + int error = Engine::Root().Init(); + if (error != 0) + { + ChipLogError(Shell, "Streamer initialization failed: %d", error); + return CHIP_ERROR_INTERNAL; + } + + /* Register common shell commands */ + cmd_misc_init(); + cmd_otcli_init(); +#if CHIP_SHELL_ENABLE_CMD_SERVER + cmd_app_server_init(); +#endif /* CHIP_SHELL_ENABLE_CMD_SERVER */ + + /* Register application commands */ + static const shell_command_t kCommands[] = { + { + .cmd_func = commissioningManager, + .cmd_name = "mattercommissioning", + .cmd_help = "Open/close the commissioning window. Usage : mattercommissioning [on|off]", + }, + { + .cmd_func = cliFactoryReset, + .cmd_name = "matterfactoryreset", + .cmd_help = "Perform a factory reset on the device", + }, + { + .cmd_func = cliReset, + .cmd_name = "matterreset", + .cmd_help = "Reset the device", + }, + }; + + Engine::Root().RegisterCommands(kCommands, sizeof(kCommands) / sizeof(kCommands[0])); + + if (xTaskCreate(&AppMatterCliTask, "AppMatterCli_task", MATTER_CLI_TASK_SIZE, NULL, 1, &AppMatterCliTaskHandle) != pdPASS) + { + ChipLogError(Shell, "Failed to start Matter CLI task"); + return CHIP_ERROR_INTERNAL; + } + isShellInitialized = true; + } +#endif /* ENABLE_CHIP_SHELL */ + + return CHIP_NO_ERROR; +} diff --git a/examples/all-clusters-app/nxp/common/main/AppTask.cpp b/examples/all-clusters-app/nxp/common/main/AppTask.cpp new file mode 100644 index 00000000000000..3ca3af76b96349 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/AppTask.cpp @@ -0,0 +1,477 @@ +/* + * + * Copyright (c) 2021-2023 Project CHIP Authors + * Copyright (c) 2021 Google LLC. + * Copyright 2023 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "AppTask.h" +#include "AppEvent.h" +#include "CHIPDeviceManager.h" +#include "DeviceCallbacks.h" +#include "binding-handler.h" +#include "lib/core/ErrorStr.h" +#include +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "AppFactoryData.h" +#include "AppMatterButton.h" +#include "AppMatterCli.h" + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +#include "OTARequestorInitiator.h" +#endif + +#if ENABLE_OTA_PROVIDER +#include +#endif + +#if CHIP_ENABLE_OPENTHREAD +#include +#endif + +#if TCP_DOWNLOAD +#include "TcpDownload.h" +#endif + +#ifndef APP_TASK_STACK_SIZE +#define APP_TASK_STACK_SIZE ((configSTACK_DEPTH_TYPE) 6144 / sizeof(portSTACK_TYPE)) +#endif +#ifndef APP_TASK_PRIORITY +#define APP_TASK_PRIORITY 2 +#endif +#define APP_EVENT_QUEUE_SIZE 10 + +static QueueHandle_t sAppEventQueue; + +using namespace chip; +using namespace chip::TLV; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceManager; +using namespace ::chip::app::Clusters; + +chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +namespace { +chip::app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, + &(::chip::DeviceLayer::NetworkCommissioning::NXPWiFiDriver::GetInstance())); +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::StartAppTask() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TaskHandle_t taskHandle; + + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + err = CHIP_ERROR_NO_MEMORY; + ChipLogError(DeviceLayer, "Failed to allocate app event queue"); + assert(err == CHIP_NO_ERROR); + } + + if (xTaskCreate(&AppTask::AppTaskMain, "AppTaskMain", APP_TASK_STACK_SIZE, &sAppTask, APP_TASK_PRIORITY, &taskHandle) != pdPASS) + { + err = CHIP_ERROR_NO_MEMORY; + ChipLogError(DeviceLayer, "Failed to start app task"); + assert(err == CHIP_NO_ERROR); + } + + return err; +} + +#if CHIP_ENABLE_OPENTHREAD +void LockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); +} + +void UnlockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); +} +#endif + +void AppTask::InitServer(intptr_t arg) +{ + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + +#if CHIP_ENABLE_OPENTHREAD + // Init ZCL Data Model and start server + chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; + nativeParams.lockCb = LockOpenThreadTask; + nativeParams.unlockCb = UnlockOpenThreadTask; + nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(); + initParams.endpointNativeParams = static_cast(&nativeParams); +#endif + VerifyOrDie((chip::Server::GetInstance().Init(initParams)) == CHIP_NO_ERROR); + + gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage()); + chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + +#ifdef DEVICE_TYPE_ALL_CLUSTERS + // Disable last fixed endpoint, which is used as a placeholder for all of the + // supported clusters so that ZAP will generated the requisite code. + emberAfEndpointEnableDisable(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1)), false); +#endif /* DEVICE_TYPE_ALL_CLUSTERS */ + +#if ENABLE_OTA_PROVIDER + InitOTAServer(); +#endif +} + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + /* Init Chip memory management before the stack */ + chip::Platform::MemoryInit(); + + /* Initialize Matter factory data before initializing the Matter stack */ + err = AppFactoryData_PreMatterStackInit(); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Pre Factory Data Provider init failed"); + goto exit; + } + + /* + * Initialize the CHIP stack. + * Would also initialize all required platform modules + */ + err = PlatformMgr().InitChipStack(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "PlatformMgr().InitChipStack() failed: %s", ErrorStr(err)); + goto exit; + } + + /* Initialize Matter factory data after initializing the Matter stack */ + err = AppFactoryData_PostMatterStackInit(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Post Factory Data Provider init failed"); + goto exit; + } + + /* + * Register all application callbacks allowing to be informed of stack events + */ + err = CHIPDeviceManager::GetInstance().Init(&deviceCallbacks); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "CHIPDeviceManager.Init() failed: %s", ErrorStr(err)); + goto exit; + } + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + ConnectivityMgrImpl().StartWiFiManagement(); +#endif + +#if CHIP_ENABLE_OPENTHREAD + err = ThreadStackMgr().InitThreadStack(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during ThreadStackMgr().InitThreadStack()"); + goto exit; + } + + err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); + if (err != CHIP_NO_ERROR) + { + goto exit; + } +#endif + + /* + * Schedule an event to the Matter stack to initialize + * the ZCL Data Model and start server + */ + PlatformMgr().ScheduleWork(InitServer, 0); + + /* Init binding handlers */ + err = InitBindingHandlers(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "InitBindingHandlers failed: %s", ErrorStr(err)); + goto exit; + } + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + NetWorkCommissioningInstInit(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + /* If an update is under test make it permanent */ + OTARequestorInitiator::Instance().HandleSelfTest(); +#endif + + /* Register Matter CLI cmds */ + err = AppMatterCli_RegisterCommands(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during AppMatterCli_RegisterCommands"); + goto exit; + } + /* Register Matter buttons */ + err = AppMatterButton_registerButtons(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during AppMatterButton_registerButtons"); + goto exit; + } + + err = DisplayDeviceInformation(); + if (err != CHIP_NO_ERROR) + goto exit; + + /* Start a task to run the CHIP Device event loop. */ + err = PlatformMgr().StartEventLoopTask(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during PlatformMgr().StartEventLoopTask()"); + goto exit; + } + +#if CHIP_ENABLE_OPENTHREAD + // Start OpenThread task + err = ThreadStackMgrImpl().StartThreadTask(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during ThreadStackMgrImpl().StartThreadTask()"); + goto exit; + } +#endif + +#if TCP_DOWNLOAD + EnableTcpDownloadComponent(); +#endif + +exit: + return err; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppTask * task = (AppTask *) pvParameter; + CHIP_ERROR err; + AppEvent event; + + ChipLogProgress(DeviceLayer, "Welcome to NXP All Clusters Demo App"); + + err = task->Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "AppTask.Init() failed"); + assert(err == CHIP_NO_ERROR); + } + + while (true) + { + BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); + while (eventReceived == pdTRUE) + { + sAppTask.DispatchEvent(&event); + eventReceived = xQueueReceive(sAppEventQueue, &event, 0); + } + } +} + +CHIP_ERROR AppTask::DisplayDeviceInformation(void) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + uint16_t discriminator; + uint32_t setupPasscode; + uint16_t vendorId; + uint16_t productId; + char currentSoftwareVer[ConfigurationManager::kMaxSoftwareVersionStringLength + 1]; + + err = GetCommissionableDataProvider()->GetSetupDiscriminator(discriminator); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Couldn't get discriminator: %s", ErrorStr(err)); + goto exit; + } + ChipLogProgress(DeviceLayer, "Setup discriminator: %u (0x%x)", discriminator, discriminator); + + err = GetCommissionableDataProvider()->GetSetupPasscode(setupPasscode); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Couldn't get setupPasscode: %s", ErrorStr(err)); + goto exit; + } + ChipLogProgress(DeviceLayer, "Setup passcode: %lu (0x%lx)", setupPasscode, setupPasscode); + + err = GetDeviceInstanceInfoProvider()->GetVendorId(vendorId); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Couldn't get vendorId: %s", ErrorStr(err)); + goto exit; + } + ChipLogProgress(DeviceLayer, "Vendor ID: %u (0x%x)", vendorId, vendorId); + + err = GetDeviceInstanceInfoProvider()->GetProductId(productId); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Couldn't get productId: %s", ErrorStr(err)); + goto exit; + } + ChipLogProgress(DeviceLayer, "nProduct ID: %u (0x%x)", productId, productId); + + // QR code will be used with CHIP Tool +#if CONFIG_NETWORK_LAYER_BLE + PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); +#else + PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork)); +#endif /* CONFIG_NETWORK_LAYER_BLE */ + + err = ConfigurationMgr().GetSoftwareVersionString(currentSoftwareVer, sizeof(currentSoftwareVer)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Get current software version error"); + goto exit; + } + + ChipLogProgress(DeviceLayer, "Current Software Version: %s", currentSoftwareVer); + +exit: + return err; +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (sAppEventQueue != NULL) + { + if (!xQueueSend(sAppEventQueue, aEvent, 0)) + { + ChipLogError(DeviceLayer, "Failed to post event to app task event queue"); + } + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + if (aEvent->Handler) + { + aEvent->Handler(aEvent); + } + else + { + ChipLogProgress(DeviceLayer, "Event received with no handler. Dropping event."); + } +} + +void AppTask::StartCommissioning(intptr_t arg) +{ + /* Check the status of the commissioning */ + if (ConfigurationMgr().IsFullyProvisioned()) + { + ChipLogProgress(DeviceLayer, "Device already commissioned"); + } + else if (chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen()) + { + ChipLogProgress(DeviceLayer, "Commissioning window already opened"); + } + else + { + chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + } +} + +void AppTask::StopCommissioning(intptr_t arg) +{ + /* Check the status of the commissioning */ + if (ConfigurationMgr().IsFullyProvisioned()) + { + ChipLogProgress(DeviceLayer, "Device already commissioned"); + } + else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen()) + { + ChipLogProgress(DeviceLayer, "Commissioning window not opened"); + } + else + { + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + } +} + +void AppTask::SwitchCommissioningState(intptr_t arg) +{ + /* Check the status of the commissioning */ + if (ConfigurationMgr().IsFullyProvisioned()) + { + ChipLogProgress(DeviceLayer, "Device already commissioned"); + } + else if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen()) + { + chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + } + else + { + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + } +} + +void AppTask::StartCommissioningHandler(void) +{ + /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */ + PlatformMgr().ScheduleWork(StartCommissioning, 0); +} + +void AppTask::StopCommissioningHandler(void) +{ + /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */ + PlatformMgr().ScheduleWork(StopCommissioning, 0); +} + +void AppTask::SwitchCommissioningStateHandler(void) +{ + /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */ + PlatformMgr().ScheduleWork(SwitchCommissioningState, 0); +} + +void AppTask::FactoryResetHandler(void) +{ + ConfigurationMgr().InitiateFactoryReset(); +} diff --git a/examples/all-clusters-app/nxp/common/main/CHIPDeviceManager.cpp b/examples/all-clusters-app/nxp/common/main/CHIPDeviceManager.cpp new file mode 100644 index 00000000000000..9211601de61862 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/CHIPDeviceManager.cpp @@ -0,0 +1,63 @@ +/* + * + * 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 + * This file implements the CHIP Device Interface that is used by + * applications to interact with the CHIP stack + * + */ + +#include + +#include "CHIPDeviceManager.h" +#include +#include +#include +#include +#include + +using namespace ::chip; + +namespace chip { + +namespace DeviceManager { + +using namespace ::chip::DeviceLayer; + +void CHIPDeviceManager::CommonDeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + CHIPDeviceManagerCallbacks * cb = reinterpret_cast(arg); + if (cb != nullptr) + { + cb->DeviceEventCallback(event, reinterpret_cast(cb)); + } +} + +CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb) +{ + CHIP_ERROR err; + mCB = cb; + + // Register a function to receive events from the CHIP device layer. Note that calls to + // this function will happen on the CHIP event loop thread. + err = PlatformMgr().AddEventHandler(CHIPDeviceManager::CommonDeviceEventHandler, reinterpret_cast(cb)); + + return err; +} +} // namespace DeviceManager +} // namespace chip diff --git a/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp b/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..419ad3b3003b2e --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/DeviceCallbacks.cpp @@ -0,0 +1,177 @@ +/* + * + * Copyright (c) 2020-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" + +#include +#include +#include + +#include +#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED +#include "openthread-system.h" +#include "ot_platform_common.h" +#endif /* CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED */ + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +#include "OTARequestorInitiator.h" +#endif + +Identify gIdentify0 = { + chip::EndpointId{ 1 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyTriggerEffect"); }, +}; + +Identify gIdentify1 = { + chip::EndpointId{ 1 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyTriggerEffect"); }, +}; + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; + +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + ChipLogDetail(DeviceLayer, "DeviceEventCallback: 0x%04x", event->Type); + switch (event->Type) + { + case DeviceEventType::kWiFiConnectivityChange: + OnWiFiConnectivityChange(event); + break; + + case DeviceEventType::kInternetConnectivityChange: + OnInternetConnectivityChange(event); + break; + + case DeviceEventType::kInterfaceIpAddressChanged: + OnInterfaceIpAddressChanged(event); + break; + +#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + case DeviceEventType::kCommissioningComplete: + DeviceCallbacks::OnComissioningComplete(event); + break; +#endif + case DeviceLayer::DeviceEventType::kDnssdInitialized: + ChipLogProgress(DeviceLayer, "kDnssdInitialized"); +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + /* Initialize OTA Requestor */ + OTARequestorInitiator::Instance().InitOTA(reinterpret_cast(&OTARequestorInitiator::Instance())); +#endif + break; + } +} + +void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, uint8_t type, + uint16_t size, uint8_t * value) +{ + ChipLogProgress(DeviceLayer, + "endpointId " ChipLogFormatMEI " clusterId " ChipLogFormatMEI " attribute ID: " ChipLogFormatMEI + " Type: %u Value: %u, length %u", + ChipLogValueMEI(endpointId), ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId), type, *value, size); +} + +void DeviceCallbacks::OnWiFiConnectivityChange(const ChipDeviceEvent * event) +{ + if (event->WiFiConnectivityChange.Result == kConnectivity_Established) + { + ChipLogProgress(DeviceLayer, "WiFi connection established"); + } + else if (event->WiFiConnectivityChange.Result == kConnectivity_Lost) + { + ChipLogProgress(DeviceLayer, "WiFi connection lost"); + } +} + +void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) +{ + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) + { + char ip_addr[Inet::IPAddress::kMaxStringLength]; + event->InternetConnectivityChange.ipAddress.ToString(ip_addr); + ChipLogProgress(DeviceLayer, "Server ready at: %s:%d", ip_addr, CHIP_PORT); + } + else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost) + { + ChipLogProgress(DeviceLayer, "Lost IPv4 connectivity..."); + } + if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established) + { + char ip_addr[Inet::IPAddress::kMaxStringLength]; + event->InternetConnectivityChange.ipAddress.ToString(ip_addr); + ChipLogProgress(DeviceLayer, "IPv6 Server ready at: [%s]:%d", ip_addr, CHIP_PORT); + } + else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) + { + ChipLogProgress(DeviceLayer, "Lost IPv6 connectivity..."); + } +} + +void DeviceCallbacks::OnInterfaceIpAddressChanged(const ChipDeviceEvent * event) +{ + switch (event->InterfaceIpAddressChanged.Type) + { + case InterfaceIpChangeType::kIpV4_Assigned: + ChipLogProgress(DeviceLayer, "Interface IPv4 address assigned"); + break; + case InterfaceIpChangeType::kIpV4_Lost: + ChipLogProgress(DeviceLayer, "Interface IPv4 address lost"); + break; + case InterfaceIpChangeType::kIpV6_Assigned: + ChipLogProgress(DeviceLayer, "Interface IPv6 address assigned"); + break; + case InterfaceIpChangeType::kIpV6_Lost: + ChipLogProgress(DeviceLayer, "Interface IPv6 address lost"); + break; + } +} + +#if CHIP_ENABLE_OPENTHREAD && CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED +void DeviceCallbacks::OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event) +{ + /* + * If a transceiver supporting a multiprotocol scenario is used, a check of the provisioning state is required, + * so that we can inform the transceiver to stop BLE to give the priority to another protocol. + * For example it is the case when a K32W0 transceiver supporting OT+BLE+Zigbee is used. When the device is already provisioned, + * BLE is no more required and the transceiver needs to be informed so that Zigbee can be switched on and BLE switched off. + * + * If a transceiver does not support such vendor property the cmd would be ignored. + */ + if (ConfigurationMgr().IsFullyProvisioned()) + { + ChipLogDetail(DeviceLayer, "Provisioning complete, stopping BLE\n"); + ThreadStackMgrImpl().LockThreadStack(); + PlatformMgrImpl().StopBLEConnectivity(); + ThreadStackMgrImpl().UnlockThreadStack(); + } +} +#endif diff --git a/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp b/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp new file mode 100644 index 00000000000000..86ea10f4687558 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp @@ -0,0 +1,41 @@ +/* + * + * Copyright (c) 2021-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "AppTask.h" +#include "CHIPDeviceManager.h" + +#include +#include +#include +#include +#include + +using namespace ::chip; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value) +{ + chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = + chip::DeviceManager::CHIPDeviceManager::GetInstance().GetCHIPDeviceManagerCallbacks(); + if (cb != nullptr) + { + // propagate event to device manager + cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, type, size, value); + } +} diff --git a/examples/all-clusters-app/nxp/common/main/include/AppEvent.h b/examples/all-clusters-app/nxp/common/main/include/AppEvent.h new file mode 100644 index 00000000000000..8047da99982e23 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/AppEvent.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021 Nest Labs, Inc. + * 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 + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Timer = 0, + kEventType_TurnOn, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } ClusterEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/all-clusters-app/nxp/common/main/include/AppFactoryData.h b/examples/all-clusters-app/nxp/common/main/include/AppFactoryData.h new file mode 100644 index 00000000000000..9c84a89b0f4bc2 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/AppFactoryData.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * Copyright 2023 NXP + * 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. + */ + +#ifndef _APP_FACTORY_DATA_H_ +#define _APP_FACTORY_DATA_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Allows to register Matter factory data before initializing the Matter stack + */ +CHIP_ERROR AppFactoryData_PreMatterStackInit(void); + +/** + * Allows to register Matter factory data after initializing the Matter stack + */ +CHIP_ERROR AppFactoryData_PostMatterStackInit(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _APP_FACTORY_DATA_H_ */ diff --git a/examples/all-clusters-app/nxp/common/main/include/AppMatterButton.h b/examples/all-clusters-app/nxp/common/main/include/AppMatterButton.h new file mode 100644 index 00000000000000..0c107269be620a --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/AppMatterButton.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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. + */ + +#ifndef _MATTER_BUTTON_H_ +#define _MATTER_BUTTON_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * API allowing to register matter buttons + */ +CHIP_ERROR AppMatterButton_registerButtons(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _MATTER_BUTTON_H_ */ diff --git a/examples/all-clusters-app/nxp/common/main/include/AppMatterCli.h b/examples/all-clusters-app/nxp/common/main/include/AppMatterCli.h new file mode 100644 index 00000000000000..ee043e52320782 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/AppMatterCli.h @@ -0,0 +1,26 @@ +/* + * Copyright 2022 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _MATTER_CLI_H_ +#define _MATTER_CLI_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * API allowing to register matter cli command + */ +CHIP_ERROR AppMatterCli_RegisterCommands(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _MATTER_CLI_H_ */ diff --git a/examples/all-clusters-app/nxp/common/main/include/AppTask.h b/examples/all-clusters-app/nxp/common/main/include/AppTask.h new file mode 100644 index 00000000000000..e276e287aa92a6 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/AppTask.h @@ -0,0 +1,65 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021-2023 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 "DeviceCallbacks.h" + +class AppTask +{ +public: + CHIP_ERROR StartAppTask(); + static void AppTaskMain(void * pvParameter); + + void PostEvent(const AppEvent * event); + + /* Commissioning handlers */ + void StartCommissioningHandler(void); + void StopCommissioningHandler(void); + void SwitchCommissioningStateHandler(void); + + /* FactoryResetHandler */ + void FactoryResetHandler(void); + +private: + DeviceCallbacks deviceCallbacks; + + friend AppTask & GetAppTask(void); + + CHIP_ERROR Init(); + void DispatchEvent(AppEvent * event); + CHIP_ERROR DisplayDeviceInformation(void); + + /* Functions that would be called in the Matter task context */ + static void StartCommissioning(intptr_t arg); + static void StopCommissioning(intptr_t arg); + static void SwitchCommissioningState(intptr_t arg); + static void InitServer(intptr_t arg); + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/all-clusters-app/nxp/common/main/include/CHIPDeviceManager.h b/examples/all-clusters-app/nxp/common/main/include/CHIPDeviceManager.h new file mode 100644 index 00000000000000..3f3d6e51eb4067 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/CHIPDeviceManager.h @@ -0,0 +1,125 @@ +/* + * + * 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 + * This file contains definitions for the CHIP DeviceManager Interface + * + * This object will co-ordinate multiple activities such as + * initialisation, rendezvous, session mgmt and other such + * activities within the CHIP stack. This is a singleton object. + */ + +#pragma once + +#include +#include +#include + +#include + +#include +#include + +#include + +namespace chip { +namespace DeviceManager { + +/** + * @brief + * This class provides a skeleton for all the callback functions. The functions will be + * called by other objects within the CHIP stack for specific events. + * Applications interested in receiving specific callbacks can specialize this class and handle + * these events in their implementation of this class. + */ +class DLL_EXPORT CHIPDeviceManagerCallbacks +{ +public: + /** + * @brief + * Called when CHIP Device events (PublicEventTypes) are triggered. + * + * @param event ChipDeviceEvent that occurred + * @param arg arguments specific to the event, if any + */ + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) {} + + /** + * @brief + * Called after an attribute has been changed + * + * @param endpoint endpoint id + * @param clusterID cluster id + * @param attributeId attribute id that was changed + * @param mask mask of the attribute + * @param manufacturerCode manufacturer code + * @param type attribute type + * @param size size of the attribute + * @param value pointer to the new value + */ + virtual void PostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value) + {} + + virtual ~CHIPDeviceManagerCallbacks() {} +}; + +/** + * @brief + * A common class that drives other components of the CHIP stack + */ +class DLL_EXPORT CHIPDeviceManager +{ +public: + CHIPDeviceManager(const CHIPDeviceManager &) = delete; + CHIPDeviceManager(const CHIPDeviceManager &&) = delete; + CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete; + + static CHIPDeviceManager & GetInstance() + { + static CHIPDeviceManager instance; + return instance; + } + + /** + * @brief + * Initialise CHIPDeviceManager + * + * @param cb Application's instance of the CHIPDeviceManagerCallbacks for consuming events + */ + CHIP_ERROR Init(CHIPDeviceManagerCallbacks * cb); + + /** + * @brief + * Fetch a pointer to the registered CHIPDeviceManagerCallbacks object. + * + */ + CHIPDeviceManagerCallbacks * GetCHIPDeviceManagerCallbacks() { return mCB; } + + /** + * Use internally for registration of the ChipDeviceEvents + */ + static void CommonDeviceEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + +private: + CHIPDeviceManagerCallbacks * mCB = nullptr; + CHIPDeviceManager() {} +}; + +} // namespace DeviceManager +} // namespace chip diff --git a/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h b/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..2a37a2dfb99a94 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/include/DeviceCallbacks.h @@ -0,0 +1,49 @@ +/* + * + * 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. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#pragma once + +#include "CHIPDeviceManager.h" +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, + uint8_t type, uint16_t size, uint8_t * value); + +private: + void OnWiFiConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnSessionEstablished(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnInterfaceIpAddressChanged(const chip::DeviceLayer::ChipDeviceEvent * event); + void OnOnOffPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); + void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); +#if CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + void OnComissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event); +#endif +}; diff --git a/examples/all-clusters-app/nxp/common/main/main.cpp b/examples/all-clusters-app/nxp/common/main/main.cpp new file mode 100644 index 00000000000000..c2305cf9ac4eb6 --- /dev/null +++ b/examples/all-clusters-app/nxp/common/main/main.cpp @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021-2023 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. + */ + +// ================================================================================ +// Main Code +// ================================================================================ + +#include "FreeRTOS.h" +#include +#include +#include + +#if configAPPLICATION_ALLOCATED_HEAP +uint8_t __attribute__((section(".heap"))) ucHeap[configTOTAL_HEAP_SIZE]; +#endif + +using namespace ::chip::DeviceLayer; + +extern "C" int main(int argc, char * argv[]) +{ + TaskHandle_t taskHandle; + + PlatformMgrImpl().HardwareInit(); + GetAppTask().StartAppTask(); + vTaskStartScheduler(); +} + +#if (defined(configCHECK_FOR_STACK_OVERFLOW) && (configCHECK_FOR_STACK_OVERFLOW > 0)) +void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + assert(0); +} +#endif diff --git a/examples/all-clusters-app/nxp/rt/rw61x/.gn b/examples/all-clusters-app/nxp/rt/rw61x/.gn new file mode 100644 index 00000000000000..c0a26c2dc77832 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/.gn @@ -0,0 +1,33 @@ +# Copyright (c) 2020 Project CHIP Authors +# Copyright 2023 NXP +# +# 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") +import("//build_overrides/chip.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_cpu = "arm" + target_os = "freertos" + + import("//args.gni") + + # Import default platform configs + import("${chip_root}/src/platform/nxp/rt/rw61x/args.gni") +} diff --git a/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn new file mode 100644 index 00000000000000..4c0ccba283249b --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn @@ -0,0 +1,191 @@ +# Copyright (c) 2021 Project CHIP Authors +# Copyright 2023 NXP +# +# 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") +import("//build_overrides/chip.gni") +import("//build_overrides/nxp_sdk.gni") +import("//build_overrides/openthread.gni") +import("${chip_root}/src/platform/device.gni") + +#allows to get common NXP SDK gn options +import("${nxp_sdk_build_root}/nxp_sdk.gni") + +# Allows to get various RT gn options +import("${nxp_sdk_build_root}/${nxp_sdk_name}/rt_sdk.gni") + +import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni") +import( + "${nxp_sdk_build_root}/${nxp_sdk_name}/${rt_platform}/${rt_platform}.gni") +import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni") + +assert(current_os == "freertos") +assert(target_os == "freertos") +assert(nxp_platform == "rt/rw61x") + +declare_args() { + # This defines the device type as a "thermostat" by default, + # use "all-clusters" in order to build the all-clusters-app + nxp_device_type = "thermostat" +} + +example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" + +if (nxp_device_type == "thermostat") { + app_common_folder = "${nxp_device_type}/nxp/zap" +} else { + app_common_folder = "${nxp_device_type}-app/${nxp_device_type}-common" +} + +# Create here the SDK instance. +# Particular sources/defines/includes could be added/changed depending on the target application. +rt_sdk("sdk") { + defines = [] + + cflags = [] + public_deps = [] + public_configs = [] + sources = [] + include_dirs = [] + + # Indicate paths to default board files + include_dirs += [ "${example_platform_dir}/board/" ] + sources += [ "${example_platform_dir}/board/pin_mux.c" ] + sources += [ "${example_platform_dir}/board/hardware_init.c" ] + sources += [ "${example_platform_dir}/board/clock_config.c" ] + sources += [ "${example_platform_dir}/board/board.c" ] + sources += [ "${example_platform_dir}/board/peripherals.c" ] + + # Indicate the path to CHIPProjectConfig.h + include_dirs += [ "include/config" ] + + # Indicate the default path to FreeRTOSConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/freeRTOS" ] + + # Indicate the default path to OpenThreadConfig.h + include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] +} + +# Create the SDK driver instance. +# Particular sources/defines/includes could be added to add other drivers not available in the default sdk driver template +rw61x_sdk_drivers("sdk_driver") { +} + +rt_executable("all_cluster_app") { + output_name = "chip-rw61x-all-cluster-example" + + defines = [ "CONFIG_RENDEZVOUS_MODE=7" ] + + include_dirs = [ + "../../common/main/include", + "../../common/main", + + "${chip_root}/examples/all-clusters-app/all-clusters-common/include", + "${chip_root}/examples/providers/", + ] + + sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", + "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", + "../../common/main/AppFactoryDataDefaultImpl.cpp", + "../../common/main/AppMatterButtonEmpty.cpp", + "../../common/main/AppMatterCli.cpp", + "../../common/main/AppTask.cpp", + "../../common/main/CHIPDeviceManager.cpp", + "../../common/main/DeviceCallbacks.cpp", + "../../common/main/ZclCallbacks.cpp", + "../../common/main/include/AppEvent.h", + "../../common/main/include/AppTask.h", + "../../common/main/include/CHIPDeviceManager.h", + "../../common/main/include/DeviceCallbacks.h", + "../../common/main/main.cpp", + ] + + deps = [ "${chip_root}/examples/${app_common_folder}" ] + + if (nxp_device_type == "all-clusters") { + defines += [ "DEVICE_TYPE_ALL_CLUSTERS" ] + sources += [ + "${chip_root}/examples/${app_common_folder}/src/bridged-actions-stub.cpp", + "${chip_root}/examples/${app_common_folder}/src/smco-stub.cpp", + "${chip_root}/examples/${app_common_folder}/src/static-supported-modes-manager.cpp", + ] + } + + if (chip_enable_matter_cli) { + defines += [ "ENABLE_CHIP_SHELL" ] + deps += [ + "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/lib/shell:shell", + ] + } + + if (chip_enable_ota_requestor) { + sources += [ + "${chip_root}/examples/platform/nxp/common/OTARequestorInitiator.cpp", + "${chip_root}/examples/platform/nxp/common/OTARequestorInitiator.h", + ] + include_dirs += [ "${chip_root}/examples/platform/nxp/common" ] + } + + # In case a dedicated assert function needs to be supported the flag sdk_fsl_assert_support should be set to false + # The would add to the build a dedicated application assert implementation. + if (!sdk_fsl_assert_support) { + sources += [ "../../common/main/AppAssert.cpp" ] + } + + cflags = [ "-Wconversion" ] + + ldscript = "${example_platform_dir}/app/ldscripts/RW610_flash.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-T" + rebase_path(ldscript, root_build_dir), + "-fno-common", + "-Wl,--defsym=__stack_size__=2048", + "-ffreestanding", + "-fno-builtin", + "-mapcs", + "-u qspiflash_config", + "-u image_vector_table", + "-u boot_data", + "-u dcd_data", + "-Wl,-print-memory-usage", + "-Wl,--no-warn-rwx-segments", + ] + + if (chip_enable_ota_requestor) { + if (no_mcuboot) { + # If "no_mcuboot" is set to true, the application will be linked at the base of the flash. + print( + "Warning : The OTA Requestor is enabled without MCUBoot. This will prevent the application from applying software updates.") + } else { + # we need to reserve enough space for the bootloader (MCUBoot) + # MCUBoot requires 0x20000 Bytes to be reserved at the base of the flash + # Consequently, some sections will need to be shifted + ldflags += [ "-Wl,--defsym=__m_mcuboot_size__=0x20000" ] + } + } + + output_dir = root_out_dir +} + +group("rw61x") { + deps = [ ":all_cluster_app" ] +} + +group("default") { + deps = [ ":rw61x" ] +} diff --git a/examples/all-clusters-app/nxp/rt/rw61x/README.md b/examples/all-clusters-app/nxp/rt/rw61x/README.md new file mode 100644 index 00000000000000..d5b436d9fee8e1 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/README.md @@ -0,0 +1,294 @@ +# CHIP RW61x All-clusters Application + +The all-clusters example implements a server which can be accessed by a CHIP +controller and can accept basic cluster commands. + +The example is based on +[Project CHIP](https://github.com/project-chip/connectedhomeip) and the NXP +RW612 SDK, and provides a prototype application that demonstrates device +commissioning and different cluster control. + +
+ +- [Introduction](#introduction) +- [Building](#building) +- [Flashing and debugging](#flashing-and-debugging) +- [Testing the example](#testing-the-example) +- [Matter Shell](#testing-the-all-clusters-application-with-matter-cli-enabled) +- [OTA Software Update](#ota-software-update) + +
+ + + +## Introduction + +The RW61x all-cluster application provides a working demonstration of the +RW610/RW612 board integration, built using the Project CHIP codebase and the NXP +RW612 SDK. The example supports basic ZCL commands and acts as a thermostat +device-type. + +The example supports: + +- Matter over Wi-Fi +- Matter over Openthread + +### Hardware requirements + +For Matter over Thread configuration : + +- [`NXP RD-RW612-BGA`] board +- BLE/15.4 antenna (to plug in Ant1) + +For Matter over WiFi configuration : + +- [`NXP RD-RW612-BGA`] or [`NXP RD-RW610-BGA`] board +- BLE antenna (to plug in Ant1) +- Wi-Fi antenna (to plug in Ant2) + + + +## Building + +In order to build the Project CHIP example, we recommend using a Linux +distribution (the demo-application was compiled on Ubuntu 20.04). + +- Follow instruction in [BUILDING.md](../../../../../docs/guides/BUILDING.md) + to setup the environment to be able to build Matter. + +- Download [RD-RW612 SDK v2.13.1](https://mcuxpresso.nxp.com/en/select). + Creating an nxp.com account is required before being able to download the + SDK. Once the account is created, login and follow the steps for downloading + SDK. The SDK Builder UI selection should be similar with the one from the + image below. In case you do not have access to the SDK, please ask your NXP + representative. + + ![MCUXpresso SDK Download](../../../../platform/nxp/rt/rw61x/doc/images/mcux-sdk-download.PNG) + + (Note: All SDK components should be selected. If size is an issue Azure RTOS + component can be omitted.) + +- Start building the application. + +``` +user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_SDK_ROOT=/home/user/Desktop/SDK_RW612/ +user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh +user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/all-clusters-app/nxp/rt/rw61x/ +``` + +#### Building with Matter over Wifi configuration on RW61x + +- Build Matter-over-Wifi configuration with BLE commissioning (ble-wifi) : + +``` +user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ gn gen --args="chip_enable_wifi=true is_sdk_package=true" out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ ninja -C out/debug +``` + +#### Building with Matter over Thread configuration on RW612 + +- Build the Openthread configuration with BLE commissioning. + +``` +user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ gn gen --args="chip_enable_openthread=true chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=true is_sdk_package=true" out/debug +user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x$ ninja -C out/debug +``` + +#### General information + +The resulting output file can be found in +out/debug/chip-rw61x-all-cluster-example. + +Optional GN options that can be added when building an application: + +- To enable the + [matter CLI](README.md#testing-the-all-clusters-application-with-matter-cli-enabled), + the argument `chip_enable_matter_cli=true` must be added to the _gn gen_ + command. +- To switch the SDK type used, the argument `is_=true` must be added + to the _gn gen_ command (with being either sdk_package or + sdk_internal). +- By default, the RW612 A1 board revision will be chosen. To switch to an A0 + revision, the argument `board_version=\"A0\"` must be added to the _gn gen_ + command. +- To build the application in debug mode, the argument + `is_debug=true optimize_debug=false` must be added to the _gn gen_ command. +- To build with the option to have Matter certificates/keys pre-loaded in a + specific flash area the argument `chip_with_factory_data=1` must be added to + the _gn gen_ command. (for more information see + [Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp_manufacturing_flow.md). +- To build the application with the OTA Requestor enabled, the arguments + `chip_enable_ota_requestor=true no_mcuboot=false` must be added to the _gn + gen_ command. (More information about the OTA Requestor feature in + [OTA Requestor README](README_OTA_Requestor.md))) + +## Manufacturing data + +See +[Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp_manufacturing_flow.md) + +Other comments: + +The all cluster app demonstrates the usage of encrypted Matter manufacturing +data storage. Matter manufacturing data should be encrypted using an AES 128 +software key before flashing them to the device flash. + + + +## Flashing and debugging + +### Flashing the All-Clusters application + +In order to flash the application we recommend using +[MCUXpresso IDE (version >= 11.6.0)](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE). + +- Import the previously downloaded NXP SDK into MCUXpresso IDE. + +Right click the empty space in the MCUXpresso IDE "Installed SDKs" tab to show +the menu, select the "Import archive" (or "Import folder" if a folder is used) +menu item. + +- Import the connectedhomeip repo in MCUXpresso IDE as Makefile Project. Use + _none_ as _Toolchain for Indexer Settings_: + +``` +File -> Import -> C/C++ -> Existing Code as Makefile Project +``` + +- Configure MCU Settings: + +``` +Right click on the Project -> Properties -> C/C++ Build -> MCU Settings -> Select RW612 -> Apply & Close +``` + +![MCU_Set](../../../../platform/nxp/rt/rw61x/doc/images/mcu-set.PNG) + +- Configure the toolchain editor: + +``` +Right click on the Project -> C/C++ Build-> Tool Chain Editor -> NXP MCU Tools -> Apply & Close +``` + +![toolchain](../../../../platform/nxp/rt/rw61x/doc/images/toolchain.JPG) + +- Create a debug configuration : + +``` +Right click on the Project -> Debug -> As->SEGGER JLink probes -> OK -> Select elf file +``` + +(Note : if SDK package is used, a simpler way could be duplicating the debug +configuration from the SDK Hello World example after importing it.) + +- Debug using the newly created configuration file. + + + +## Testing the example + +CHIP Tool is a Matter controller which can be used to commission a Matter device +into the network. For more information regarding how to use the CHIP Tool +controller, please refer to the +[CHIP Tool guide](../../../../../docs/guides/chip_tool_guide.md). + +To know how to commission a device over BLE, follow the instructions from +[chip-tool's README.md 'Commission a device over +BLE'][readme_ble_commissioning_section]. + +[readme_ble_commissioning_section]: + ../../../../chip-tool/README.md#commission-a-device-over-ble + +To know how to commissioning a device over IP, follow the instructions from +[chip-tool's README.md 'Pair a device over +IP'][readme_pair_ip_commissioning_section] + +[readme_pair_ip_commissioning_section]: + ../../../../chip-tool/README.md#pair-a-device-over-ip + +#### Matter over wifi configuration : + +The "ble-wifi" pairing method can be used in order to commission the device. + +#### Matter over thread configuration : + +The "ble-thread" pairing method can be used in order to commission the device. + +### Testing the all-clusters application without Matter CLI: + +1. Prepare the board with the flashed `All-cluster application` (as shown + above). +2. The All-cluster example uses UART1 (`FlexComm3`) to print logs while running + the server. To view raw UART output, start a terminal emulator like PuTTY and + connect to the used COM port with the following UART settings: + + - Baud rate: 115200 + - 8 data bits + - 1 stop bit + - No parity + - No flow control + +3. Open a terminal connection on the board and watch the printed logs. + +4. On the client side, start sending commands using the chip-tool application as + it is described + [here](../../../../chip-tool/README.md#using-the-client-to-send-matter-commands). + + + +### Testing the all-clusters application with Matter CLI enabled: + +The Matter CLI can be enabled with the all-clusters application. + +For more information about the Matter CLI default commands, you can refer to the +dedicated [ReadMe](../../../../shell/README.md). + +The All-clusters application supports additional commands : + +``` +> help +[...] +mattercommissioning Open/close the commissioning window. Usage : mattercommissioning [on|off] +matterfactoryreset Perform a factory reset on the device +matterreset Reset the device +``` + +- `matterfactoryreset` command erases the file system completely (all Matter + settings are erased). +- `matterreset` enables the device to reboot without erasing the settings. + +Here are described steps to use the all-cluster-app with the Matter CLI enabled + +1. Prepare the board with the flashed `All-cluster application` (as shown + above). +2. The matter CLI is accessible in UART1. For that, start a terminal emulator + like PuTTY and connect to the used COM port with the following UART settings: + + - Baud rate: 115200 + - 8 data bits + - 1 stop bit + - No parity + - No flow control + +3. The All-cluster example uses UART2 (`FlexComm0`) to print logs while running + the server. To view raw UART output, a pin should be plugged to an USB to + UART adapter (connector `HD2 pin 03`), then start a terminal emulator like + PuTTY and connect to the used COM port with the following UART settings: + + - Baud rate: 115200 + - 8 data bits + - 1 stop bit + - No parity + - No flow control + +4. On the client side, start sending commands using the chip-tool application as + it is described + [here](../../../../chip-tool/README.md#using-the-client-to-send-matter-commands). + + + +## OTA Software Update + +Over-The-Air software updates are supported with the RW61x all-clusters example. +The process to follow in order to perform a software update is described in the +dedicated guide +['Matter Over-The-Air Software Update with NXP RW61x example applications'](../../../../../docs/guides/nxp_rw61x_ota_software_update.md). diff --git a/examples/all-clusters-app/nxp/rt/rw61x/args.gni b/examples/all-clusters-app/nxp/rt/rw61x/args.gni new file mode 100644 index 00000000000000..c2d91a5db7bae7 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/args.gni @@ -0,0 +1,19 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +# SDK target definitions +nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") +nxp_sdk_driver_target = get_label_info(":sdk_driver", "label_no_toolchain") diff --git a/examples/all-clusters-app/nxp/rt/rw61x/build_overrides b/examples/all-clusters-app/nxp/rt/rw61x/build_overrides new file mode 120000 index 00000000000000..f10867042f4d19 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/build_overrides @@ -0,0 +1 @@ +../../../../build_overrides \ No newline at end of file diff --git a/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h b/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h new file mode 100644 index 00000000000000..9fe84849fd753f --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/include/config/CHIPProjectConfig.h @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 Google LLC. + * Copyright 2023 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * 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. + * + */ + +#pragma once + +/* + * Tells to the platform Factory Data Provider whether to use the example configuration or real/provisioned data. + */ +#ifndef CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA +#define CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +#if !CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" + +/** + * CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER "DUMMY_SN" + +#endif /* !CONFIG_CHIP_PLAT_LOAD_REAL_FACTORY_DATA */ + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING NXP_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION NXP_CONFIG_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "NXP Semiconductors" +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "NXP Demo App" +#endif + +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0xFFF1 +//-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, +// 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, +// 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, +// 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, +// 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, +// 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, +// 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] +//-> device_type_id = 0x0016 +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 0 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, \ + 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, \ + 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, \ + 0x01, 0x62, 0x04, 0x82, 0x01, 0x5e, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, \ + 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, \ + 0x07, 0x80, 0x05, 0x08, 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, \ + 0x80, 0x05, 0x0e, 0x80, 0x05, 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, \ + 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, \ + 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, \ + 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, \ + 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, \ + 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, \ + 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, \ + 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, \ + 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, \ + 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, 0x4b, 0x80, 0x05, 0x4c, 0x80, \ + 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, 0x05, 0x52, 0x80, 0x05, \ + 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, 0x80, 0x05, 0x59, \ + 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, 0x5f, 0x80, \ + 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, 0x13, \ + 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, \ + 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, \ + 0x01, 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, \ + 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x24, 0xe5, \ + 0xd1, 0xf4, 0x7a, 0x7d, 0x7b, 0x0d, 0x20, 0x6a, 0x26, 0xef, 0x69, 0x9b, 0x7c, 0x97, 0x57, 0xb7, 0x2d, 0x46, 0x90, \ + 0x89, 0xde, 0x31, 0x92, 0xe6, 0x78, 0xc7, 0x45, 0xe7, 0xf6, 0x0c, 0x02, 0x21, 0x00, 0xf8, 0xaa, 0x2f, 0xa7, 0x11, \ + 0xfc, 0xb7, 0x9b, 0x97, 0xe3, 0x97, 0xce, 0xda, 0x66, 0x7b, 0xae, 0x46, 0x4e, 0x2b, 0xd3, 0xff, 0xdf, 0xc3, 0xcc, \ + 0xed, 0x7a, 0xa8, 0xca, 0x5f, 0x4c, 0x1a, 0x7c \ + } +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote CHIP Time service + * using the CHIP Time Sync protocol. + */ +// #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1 + +/** + * CHIP_CONFIG_MAX_BINDINGS + * + * Maximum number of simultaneously active bindings per ChipExchangeManager + * 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4 + * in the worst case. Keeping another 4 as buffer. + */ +#define CHIP_CONFIG_MAX_BINDINGS 6 + +/** + * CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD + * + * Select the ability to offload event logs to any interested subscribers using WDM. + */ +#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1 + +/** + * 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 + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +/* Increasing the retransmission interval of the MRP messages after subsequent failures */ +#ifndef CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) +#endif diff --git a/examples/all-clusters-app/nxp/rt/rw61x/third_party/connectedhomeip b/examples/all-clusters-app/nxp/rt/rw61x/third_party/connectedhomeip new file mode 120000 index 00000000000000..305f2077ffe860 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../../.. \ No newline at end of file diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 3b3f3ac44bf4cd..46b7b72960b65b 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -76,7 +76,6 @@ add_definitions( target_sources(app PRIVATE src/AppTask.cpp - src/ZclDoorLockCallbacks.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/smco-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-temperature-levels.cpp diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index a8881b7fdeb024..b8f5b95d828893 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -23,7 +23,7 @@ creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for 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 f7ae8b3196bc0e..5a4a521d090db2 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 @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -241,33 +241,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -304,23 +304,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -403,7 +403,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -441,7 +441,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -455,13 +455,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -469,7 +469,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -525,19 +525,19 @@ server cluster AccessControl = 31 { /** This cluster provides a standardized way for a Node (typically a Bridge, but could be any Node) to expose action information. */ server cluster Actions = 37 { - enum ActionErrorEnum : ENUM8 { + enum ActionErrorEnum : enum8 { kUnknown = 0; kInterrupted = 1; } - enum ActionStateEnum : ENUM8 { + enum ActionStateEnum : enum8 { kInactive = 0; kActive = 1; kPaused = 2; kDisabled = 3; } - enum ActionTypeEnum : ENUM8 { + enum ActionTypeEnum : enum8 { kOther = 0; kScene = 1; kSequence = 2; @@ -547,13 +547,13 @@ server cluster Actions = 37 { kAlarm = 6; } - enum EndpointListTypeEnum : ENUM8 { + enum EndpointListTypeEnum : enum8 { kOther = 0; kRoom = 1; kZone = 2; } - bitmap CommandBits : BITMAP16 { + bitmap CommandBits : bitmap16 { kInstantAction = 0x1; kInstantActionWithTransition = 0x2; kStartAction = 0x4; @@ -611,7 +611,7 @@ server cluster Actions = 37 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -635,7 +635,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -691,20 +691,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -765,13 +765,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -779,7 +779,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -843,7 +843,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -858,7 +858,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -873,12 +873,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -896,13 +896,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -916,7 +916,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -952,7 +952,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -966,20 +966,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -1063,38 +1063,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1145,7 +1145,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1153,7 +1153,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1209,7 +1209,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1225,7 +1225,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1234,13 +1234,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1349,13 +1357,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1363,7 +1371,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1386,7 +1394,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1396,7 +1404,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1410,7 +1418,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1418,14 +1426,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1485,8 +1493,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1513,19 +1521,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1535,7 +1543,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1628,19 +1636,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1649,7 +1657,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1659,7 +1667,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1692,7 +1700,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1705,7 +1713,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1726,14 +1734,14 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1783,21 +1791,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1810,7 +1822,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; @@ -1819,12 +1831,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1866,7 +1878,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1874,14 +1886,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1904,12 +1916,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1920,7 +1932,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1935,12 +1947,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -2055,7 +2067,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2090,7 +2102,7 @@ server cluster ModeSelect = 80 { /** Attributes and commands for configuring the temperature control, and reporting temperature. */ server cluster TemperatureControl = 86 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureNumber = 0x1; kTemperatureLevel = 0x2; kTemperatureStep = 0x4; @@ -2115,7 +2127,7 @@ server cluster TemperatureControl = 86 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -2126,13 +2138,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -2141,20 +2153,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -2169,7 +2181,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -2179,7 +2191,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -2197,7 +2209,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -2207,21 +2219,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2230,7 +2242,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -2239,7 +2251,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -2253,7 +2265,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -2261,7 +2273,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -2269,7 +2281,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -2277,7 +2289,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -2290,13 +2302,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2309,7 +2321,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2319,19 +2331,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -2340,7 +2352,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2351,7 +2363,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -2359,14 +2371,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -2380,7 +2392,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2390,13 +2402,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2406,7 +2418,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -2416,7 +2428,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -2424,7 +2436,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2434,7 +2446,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -2519,7 +2531,7 @@ server cluster DoorLock = 257 { /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -2547,7 +2559,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -2561,7 +2573,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -2571,7 +2583,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -2579,20 +2591,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; @@ -2626,7 +2638,7 @@ server cluster WindowCovering = 258 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -2635,14 +2647,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -2652,9 +2664,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -2734,13 +2746,13 @@ server cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -2749,13 +2761,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -2767,7 +2779,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2778,7 +2790,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -2788,7 +2800,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -2820,12 +2832,12 @@ server cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -2835,7 +2847,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -2844,12 +2856,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -2858,13 +2870,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } @@ -2895,53 +2907,53 @@ server cluster ThermostatUserInterfaceConfiguration = 516 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -2949,14 +2961,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2979,19 +2991,19 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring a lighting ballast. */ provisional server cluster BallastConfiguration = 769 { - bitmap BallastStatusBitmap : BITMAP8 { + bitmap BallastStatusBitmap : bitmap8 { kBallastNonOperational = 0x1; kLampFailure = 0x2; } - bitmap LampAlarmModeBitmap : BITMAP8 { + bitmap LampAlarmModeBitmap : bitmap8 { kLampBurnHours = 0x1; } readonly attribute int8u physicalMinLevel = 0; readonly attribute int8u physicalMaxLevel = 1; - attribute int8u minLevel = 16; - attribute int8u maxLevel = 17; + attribute access(write: manage) int8u minLevel = 16; + attribute access(write: manage) int8u maxLevel = 17; readonly attribute int8u lampQuantity = 32; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -3003,7 +3015,7 @@ provisional server cluster BallastConfiguration = 769 { /** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */ server cluster IlluminanceMeasurement = 1024 { - enum LightSensorTypeEnum : ENUM8 { + enum LightSensorTypeEnum : enum8 { kPhotodiode = 0; kCMOS = 1; } @@ -3021,9 +3033,9 @@ server cluster IlluminanceMeasurement = 1024 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3034,7 +3046,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -3077,18 +3089,18 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; @@ -3117,17 +3129,17 @@ server cluster WakeOnLan = 1283 { /** This cluster provides an interface for controlling the current Channel on a device. */ server cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -3169,7 +3181,7 @@ server cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ server cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -3203,7 +3215,7 @@ server cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ server cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -3212,14 +3224,14 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -3249,7 +3261,7 @@ server cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ server cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -3264,15 +3276,15 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -3307,7 +3319,7 @@ server cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ server cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -3396,13 +3408,13 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -3428,18 +3440,18 @@ server cluster KeypadInput = 1289 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -3456,12 +3468,12 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -3512,7 +3524,7 @@ server cluster ContentLauncher = 1290 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ server cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -3521,14 +3533,14 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; @@ -3549,13 +3561,13 @@ server cluster AudioOutput = 1291 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -3601,7 +3613,7 @@ server cluster ApplicationLauncher = 1292 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ server cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -3613,11 +3625,11 @@ server cluster ApplicationBasic = 1293 { char_string applicationID = 1; } - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3655,42 +3667,42 @@ server cluster AccountLogin = 1294 { /** The Test Cluster is meant to validate the generated code */ internal server cluster UnitTesting = 4294048773 { - enum SimpleEnum : ENUM8 { + enum SimpleEnum : enum8 { kUnspecified = 0; kValueA = 1; kValueB = 2; kValueC = 3; } - bitmap Bitmap16MaskMap : BITMAP16 { + bitmap Bitmap16MaskMap : bitmap16 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x4000; } - bitmap Bitmap32MaskMap : BITMAP32 { + bitmap Bitmap32MaskMap : bitmap32 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x40000000; } - bitmap Bitmap64MaskMap : BITMAP64 { + bitmap Bitmap64MaskMap : bitmap64 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x4000000000000000; } - bitmap Bitmap8MaskMap : BITMAP8 { + bitmap Bitmap8MaskMap : bitmap8 { kMaskVal1 = 0x1; kMaskVal2 = 0x2; kMaskVal3 = 0x4; kMaskVal4 = 0x40; } - bitmap SimpleBitmap : BITMAP8 { + bitmap SimpleBitmap : bitmap8 { kValueA = 0x1; kValueB = 0x2; kValueC = 0x4; @@ -4377,7 +4389,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; @@ -4940,7 +4952,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; @@ -5014,7 +5026,7 @@ endpoint 2 { } } endpoint 65534 { - device type ma_secondary_network_commissioning = 61442, version 1; + device type ma_secondary_network_commissioning = 4293984258, version 1; server cluster Descriptor { @@ -5022,6 +5034,10 @@ endpoint 65534 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; callback attribute clusterRevision default = 1; } @@ -5035,6 +5051,10 @@ endpoint 65534 { callback attribute lastNetworkingStatus; callback attribute lastNetworkID; callback attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap default = 0; callback attribute clusterRevision default = 1; 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 a900aea4ea362f..b5931df6f9ca27 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 @@ -3254,7 +3254,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4493,6 +4493,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -4802,7 +4803,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6950,6 +6951,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -7252,6 +7254,7 @@ "define": "BALLAST_CONFIGURATION_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "PhysicalMinLevel", @@ -8652,7 +8655,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8844,6 +8847,7 @@ "define": "UNIT_TESTING_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "internal", "commands": [ { "name": "Test", @@ -10789,6 +10793,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -11082,7 +11087,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11778,14 +11783,14 @@ "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" }, "deviceTypes": [ { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" @@ -11795,10 +11800,10 @@ 1 ], "deviceIdentifiers": [ - 61442 + 4293984258 ], "deviceTypeName": "MA-secondary-network-commissioning", - "deviceTypeCode": 61442, + "deviceTypeCode": 4293984258, "deviceTypeProfileId": 259, "clusters": [ { @@ -11873,6 +11878,70 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -12117,6 +12186,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -12183,5 +12316,6 @@ "endpointId": 65534, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/ameba/README.md b/examples/all-clusters-minimal-app/ameba/README.md index cf21a5a9cff37f..86c2a0f222f3a1 100644 --- a/examples/all-clusters-minimal-app/ameba/README.md +++ b/examples/all-clusters-minimal-app/ameba/README.md @@ -27,13 +27,13 @@ The CHIP demo application is supported on - Pull docker image: ``` - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 ``` - Run docker container: ``` - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 ``` - Setup build environment: diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/include/AppTask.h b/examples/all-clusters-minimal-app/nrfconnect/main/include/AppTask.h index 7db9b0b4c7b3ad..0d5a9f1f1dc84f 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/include/AppTask.h +++ b/examples/all-clusters-minimal-app/nrfconnect/main/include/AppTask.h @@ -34,13 +34,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance(void) { static AppTask sAppTask; diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index 53c750b806baf7..601fc52ba40fef 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -23,7 +23,7 @@ for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index b7fa59ec98c131..63f5eb56aa9021 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,33 +49,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -94,23 +94,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -202,7 +202,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -240,7 +240,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -254,13 +254,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ client cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -268,7 +268,7 @@ client cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -327,13 +327,13 @@ client cluster AccessControl = 31 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -341,7 +341,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -397,19 +397,19 @@ server cluster AccessControl = 31 { /** This cluster provides a standardized way for a Node (typically a Bridge, but could be any Node) to expose action information. */ server cluster Actions = 37 { - enum ActionErrorEnum : ENUM8 { + enum ActionErrorEnum : enum8 { kUnknown = 0; kInterrupted = 1; } - enum ActionStateEnum : ENUM8 { + enum ActionStateEnum : enum8 { kInactive = 0; kActive = 1; kPaused = 2; kDisabled = 3; } - enum ActionTypeEnum : ENUM8 { + enum ActionTypeEnum : enum8 { kOther = 0; kScene = 1; kSequence = 2; @@ -419,13 +419,13 @@ server cluster Actions = 37 { kAlarm = 6; } - enum EndpointListTypeEnum : ENUM8 { + enum EndpointListTypeEnum : enum8 { kOther = 0; kRoom = 1; kZone = 2; } - bitmap CommandBits : BITMAP16 { + bitmap CommandBits : bitmap16 { kInstantAction = 0x1; kInstantActionWithTransition = 0x2; kStartAction = 0x4; @@ -491,7 +491,7 @@ server cluster Actions = 37 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -515,7 +515,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -581,7 +581,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -596,7 +596,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -611,12 +611,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -636,13 +636,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -657,7 +657,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -665,7 +665,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -721,7 +721,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -737,7 +737,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -746,13 +746,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -861,13 +869,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -875,7 +883,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -898,7 +906,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -908,7 +916,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -922,7 +930,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -930,14 +938,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1003,8 +1011,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1035,19 +1043,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1057,7 +1065,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1196,19 +1204,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1217,7 +1225,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1227,7 +1235,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1268,7 +1276,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1281,7 +1289,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1302,14 +1310,14 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1360,21 +1368,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1387,7 +1399,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1401,12 +1413,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1448,7 +1460,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1456,14 +1468,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1486,12 +1498,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1502,7 +1514,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1517,12 +1529,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1605,9 +1617,9 @@ server cluster UserLabel = 65 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 71b280d3d01f5d..a317c4f078917e 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -3740,7 +3740,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index fd3d70c21e9b84..34e99505c11f4b 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -100,7 +100,7 @@ defined: 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/build_overrides/nxp_sdk.gni b/examples/build_overrides/nxp_sdk.gni new file mode 100644 index 00000000000000..5648cc858a728b --- /dev/null +++ b/examples/build_overrides/nxp_sdk.gni @@ -0,0 +1,18 @@ +# 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. + +declare_args() { + # Root directory for NXP SDKs. + nxp_sdk_build_root = "//third_party/connectedhomeip/third_party/nxp" +} diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 841eed2001cf6b..3783596b04a1f2 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -89,7 +89,9 @@ def load_config() -> None: config["ameba"]["MATTER_SDK"] = None config["ameba"]["MODEL"] = 'D' config["ameba"]["TTY"] = None - config["telink"]["ZEPHYR_BASE"] = os.environ.get('ZEPHYR_BASE') + config["telink"]["ZEPHYR_BASE"] = os.environ.get('TELINK_ZEPHYR_BASE') + config["telink"]["ZEPHYR_SDK_INSTALL_DIR"] = os.environ.get( + 'TELINK_ZEPHYR_SDK_DIR') config["telink"]["TTY"] = None flush_print(yaml.dump(config)) @@ -542,7 +544,13 @@ def main() -> int: flush_print( 'Path for Telink SDK was not found. Make sure Telink_SDK is set on your config.yaml file') exit(1) + if config['telink']['ZEPHYR_SDK_INSTALL_DIR'] is None: + flush_print( + 'Path for Telink toolchain was not found. Make sure Telink toolchain is set on your config.yaml file') + exit(1) shell.run_cmd("export ZEPHYR_TOOLCHAIN_VARIANT=zephyr") + shell.run_cmd( + f"export ZEPHYR_SDK_INSTALL_DIR={config['telink']['ZEPHYR_SDK_INSTALL_DIR']}") shell.run_cmd( f"export ZEPHYR_BASE={config['telink']['ZEPHYR_BASE']}") shell.run_cmd( @@ -763,7 +771,7 @@ def main() -> int: shell.run_cmd("make is") elif options.build_target == "telink": shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/telink") - telink_build_cmds = ["west build"] + telink_build_cmds = ["west build -b tlsr9518adk80d"] if options.do_clean: telink_build_cmds.append("-p always") if options.do_rpc: diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 1b47f3788f1da6..35637f909cfcd7 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,23 +161,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -262,7 +262,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -300,7 +300,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -314,13 +314,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -328,7 +328,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -473,20 +473,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -547,13 +547,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -561,7 +561,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -625,7 +625,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -640,7 +640,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -655,12 +655,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -677,7 +677,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -741,13 +741,13 @@ server cluster GeneralCommissioning = 48 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -755,7 +755,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -778,7 +778,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -788,7 +788,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -802,7 +802,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -810,14 +810,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -883,8 +883,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -912,24 +912,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -939,7 +939,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1080,19 +1080,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1101,7 +1101,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1111,7 +1111,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1154,7 +1154,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1167,7 +1167,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1188,26 +1188,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1220,7 +1224,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1234,12 +1238,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1281,7 +1285,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1289,14 +1293,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1319,12 +1323,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1335,7 +1339,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1350,12 +1354,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1439,18 +1443,18 @@ server cluster FixedLabel = 64 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index d9ed7dffffae80..25ac5369207196 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -3215,7 +3215,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 3e798fbc65b9c1..7e202205baad3c 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,7 +310,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -318,7 +318,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -374,7 +374,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -390,7 +390,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -399,13 +399,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -514,13 +522,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -528,7 +536,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -551,7 +559,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -561,7 +569,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -575,7 +583,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -583,14 +591,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -656,21 +664,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -683,7 +695,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -697,12 +709,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -744,7 +756,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -752,14 +764,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -782,12 +794,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -798,7 +810,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -813,12 +825,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -885,7 +897,7 @@ server cluster GroupKeyManagement = 63 { /** Attributes for reporting air quality classification */ server cluster AirQuality = 91 { - enum AirQualityEnum : ENUM8 { + enum AirQualityEnum : enum8 { kUnknown = 0; kGood = 1; kFair = 2; @@ -895,7 +907,7 @@ server cluster AirQuality = 91 { kExtremelyPoor = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kFair = 0x1; kModerate = 0x2; kVeryPoor = 0x4; @@ -913,18 +925,18 @@ server cluster AirQuality = 91 { /** Attributes and commands for monitoring HEPA filters in a device */ server cluster HepaFilterMonitoring = 113 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -932,7 +944,7 @@ server cluster HepaFilterMonitoring = 113 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -957,18 +969,18 @@ server cluster HepaFilterMonitoring = 113 { /** Attributes and commands for monitoring activated carbon filters in a device */ server cluster ActivatedCarbonFilterMonitoring = 114 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -976,7 +988,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -1001,13 +1013,13 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -1016,13 +1028,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -1034,7 +1046,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1045,7 +1057,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1055,7 +1067,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -1089,12 +1101,12 @@ server cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1104,7 +1116,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1113,12 +1125,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1127,13 +1139,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } @@ -1160,9 +1172,9 @@ provisional server cluster FanControl = 514 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1186,7 +1198,7 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes for reporting carbon monoxide concentration measurements */ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1194,13 +1206,13 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1211,7 +1223,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1240,7 +1252,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { /** Attributes for reporting carbon dioxide concentration measurements */ server cluster CarbonDioxideConcentrationMeasurement = 1037 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1248,13 +1260,13 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1265,7 +1277,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1294,7 +1306,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { /** Attributes for reporting nitrogen dioxide concentration measurements */ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1302,13 +1314,13 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1319,7 +1331,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1348,7 +1360,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { /** Attributes for reporting ozone concentration measurements */ server cluster OzoneConcentrationMeasurement = 1045 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1356,13 +1368,13 @@ server cluster OzoneConcentrationMeasurement = 1045 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1373,7 +1385,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1402,7 +1414,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { /** Attributes for reporting PM2.5 concentration measurements */ server cluster Pm25ConcentrationMeasurement = 1066 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1410,13 +1422,13 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1427,7 +1439,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1456,7 +1468,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { /** Attributes for reporting formaldehyde concentration measurements */ server cluster FormaldehydeConcentrationMeasurement = 1067 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1464,13 +1476,13 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1481,7 +1493,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1510,7 +1522,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { /** Attributes for reporting PM1 concentration measurements */ server cluster Pm1ConcentrationMeasurement = 1068 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1518,13 +1530,13 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1535,7 +1547,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1564,7 +1576,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { /** Attributes for reporting PM10 concentration measurements */ server cluster Pm10ConcentrationMeasurement = 1069 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1572,13 +1584,13 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1589,7 +1601,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1618,7 +1630,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { /** Attributes for reporting total volatile organic compounds concentration measurements */ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1626,13 +1638,13 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1643,7 +1655,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1672,7 +1684,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { /** Attributes for reporting radon concentration measurements */ server cluster RadonConcentrationMeasurement = 1071 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1680,13 +1692,13 @@ server cluster RadonConcentrationMeasurement = 1071 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1697,7 +1709,7 @@ server cluster RadonConcentrationMeasurement = 1071 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index eb7fa565cc981a..972a203fbb2822 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2776,6 +2776,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -7827,5 +7828,6 @@ "endpointId": 5, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index ebe77f6be91ead..25c89264dc5cc4 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,7 +43,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -76,13 +76,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -90,7 +90,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -148,7 +148,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -172,7 +172,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -235,20 +235,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -309,13 +309,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -323,7 +323,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -387,7 +387,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -402,7 +402,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -417,12 +417,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -439,7 +439,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -447,7 +447,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -503,7 +503,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -519,7 +519,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -528,13 +528,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -643,13 +651,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -657,7 +665,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -680,7 +688,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -690,7 +698,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -704,7 +712,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -712,14 +720,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -785,8 +793,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -814,26 +822,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -846,7 +858,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -860,12 +872,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -907,7 +919,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -915,14 +927,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -945,12 +957,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -961,7 +973,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -976,12 +988,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1065,7 +1077,7 @@ server cluster FixedLabel = 64 { /** Attributes for reporting air quality classification */ server cluster AirQuality = 91 { - enum AirQualityEnum : ENUM8 { + enum AirQualityEnum : enum8 { kUnknown = 0; kGood = 1; kFair = 2; @@ -1075,7 +1087,7 @@ server cluster AirQuality = 91 { kExtremelyPoor = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kFair = 0x1; kModerate = 0x2; kVeryPoor = 0x4; @@ -1093,10 +1105,10 @@ server cluster AirQuality = 91 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1121,7 +1133,7 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes for reporting carbon monoxide concentration measurements */ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1129,13 +1141,13 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1146,7 +1158,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1176,7 +1188,7 @@ server cluster CarbonMonoxideConcentrationMeasurement = 1036 { /** Attributes for reporting carbon dioxide concentration measurements */ server cluster CarbonDioxideConcentrationMeasurement = 1037 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1184,13 +1196,13 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1201,7 +1213,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1231,7 +1243,7 @@ server cluster CarbonDioxideConcentrationMeasurement = 1037 { /** Attributes for reporting nitrogen dioxide concentration measurements */ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1239,13 +1251,13 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1256,7 +1268,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1286,7 +1298,7 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { /** Attributes for reporting ozone concentration measurements */ server cluster OzoneConcentrationMeasurement = 1045 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1294,13 +1306,13 @@ server cluster OzoneConcentrationMeasurement = 1045 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1311,7 +1323,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1341,7 +1353,7 @@ server cluster OzoneConcentrationMeasurement = 1045 { /** Attributes for reporting PM2.5 concentration measurements */ server cluster Pm25ConcentrationMeasurement = 1066 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1349,13 +1361,13 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1366,7 +1378,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1396,7 +1408,7 @@ server cluster Pm25ConcentrationMeasurement = 1066 { /** Attributes for reporting formaldehyde concentration measurements */ server cluster FormaldehydeConcentrationMeasurement = 1067 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1404,13 +1416,13 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1421,7 +1433,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1451,7 +1463,7 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { /** Attributes for reporting PM1 concentration measurements */ server cluster Pm1ConcentrationMeasurement = 1068 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1459,13 +1471,13 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1476,7 +1488,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1506,7 +1518,7 @@ server cluster Pm1ConcentrationMeasurement = 1068 { /** Attributes for reporting PM10 concentration measurements */ server cluster Pm10ConcentrationMeasurement = 1069 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1514,13 +1526,13 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1531,7 +1543,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1561,7 +1573,7 @@ server cluster Pm10ConcentrationMeasurement = 1069 { /** Attributes for reporting total volatile organic compounds concentration measurements */ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1569,13 +1581,13 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1586,7 +1598,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; @@ -1616,7 +1628,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { /** Attributes for reporting radon concentration measurements */ server cluster RadonConcentrationMeasurement = 1071 { - enum LevelValueEnum : ENUM8 { + enum LevelValueEnum : enum8 { kUnknown = 0; kLow = 1; kMedium = 2; @@ -1624,13 +1636,13 @@ server cluster RadonConcentrationMeasurement = 1071 { kCritical = 4; } - enum MeasurementMediumEnum : ENUM8 { + enum MeasurementMediumEnum : enum8 { kAir = 0; kWater = 1; kSoil = 2; } - enum MeasurementUnitEnum : ENUM8 { + enum MeasurementUnitEnum : enum8 { kPPM = 0; kPPB = 1; kPPT = 2; @@ -1641,7 +1653,7 @@ server cluster RadonConcentrationMeasurement = 1071 { kBQM3 = 7; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNumericMeasurement = 0x1; kLevelIndication = 0x2; kMediumLevel = 0x4; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 4c056edb8a36bc..9bcbe3d733ef4d 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -6062,5 +6062,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 14d207c47ed05e..552d72bad13b31 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -3,33 +3,33 @@ /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -48,7 +48,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -81,13 +81,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -95,7 +95,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -153,7 +153,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -177,7 +177,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -240,20 +240,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -314,13 +314,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -328,7 +328,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -392,7 +392,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -407,7 +407,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -422,12 +422,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -444,7 +444,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -452,7 +452,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -508,7 +508,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -524,7 +524,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -533,13 +533,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -648,13 +656,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -662,7 +670,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -685,7 +693,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -695,7 +703,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -709,7 +717,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -717,14 +725,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -790,8 +798,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -819,26 +827,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -851,7 +863,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -865,12 +877,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -912,7 +924,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -920,14 +932,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -950,12 +962,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -966,7 +978,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -981,12 +993,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1080,17 +1092,17 @@ server cluster WakeOnLan = 1283 { /** This cluster provides an interface for controlling the current Channel on a device. */ server cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -1145,7 +1157,7 @@ server cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ server cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -1179,7 +1191,7 @@ server cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ server cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -1188,14 +1200,14 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -1225,7 +1237,7 @@ server cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ server cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -1240,15 +1252,15 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -1283,7 +1295,7 @@ server cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ server cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -1372,13 +1384,13 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -1404,7 +1416,7 @@ server cluster KeypadInput = 1289 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ server cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -1413,17 +1425,18 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; + readonly attribute int8u currentOutput = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1779,6 +1792,7 @@ endpoint 1 { server cluster AudioOutput { callback attribute outputList; + ram attribute currentOutput default = 0x00; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 3a7b75f2222908..5f7070767c1420 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3790,6 +3790,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "CurrentOutput", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -3906,5 +3922,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 15936224e0275b..f34d41305c3231 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -280,7 +280,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -313,13 +313,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -327,7 +327,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -385,7 +385,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -409,7 +409,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -472,20 +472,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -546,13 +546,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -560,7 +560,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -621,7 +621,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -629,7 +629,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -701,7 +701,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -710,13 +710,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -825,13 +833,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -839,7 +847,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -862,7 +870,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -872,7 +880,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -886,7 +894,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -894,14 +902,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -967,8 +975,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -996,26 +1004,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1028,7 +1040,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1042,12 +1054,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1089,7 +1101,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1097,14 +1109,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1127,12 +1139,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1143,7 +1155,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1158,12 +1170,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1230,53 +1242,53 @@ server cluster GroupKeyManagement = 63 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1284,14 +1296,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index c5f588ab7e04e2..54a5668ca54ea3 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -1756,7 +1756,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3902,5 +3902,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index a6800b206bf5e9..1f48ef322092f0 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,7 +112,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -150,7 +150,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -164,13 +164,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -178,7 +178,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -236,7 +236,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -260,7 +260,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -323,20 +323,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -397,13 +397,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -411,7 +411,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -475,7 +475,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -490,7 +490,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -505,12 +505,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -527,7 +527,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -535,7 +535,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -591,7 +591,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -607,7 +607,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -616,13 +616,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -731,13 +739,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -745,7 +753,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -768,7 +776,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -778,7 +786,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -792,7 +800,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -800,14 +808,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -873,8 +881,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -902,26 +910,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -934,7 +946,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -948,12 +960,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -995,7 +1007,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1003,14 +1015,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1033,12 +1045,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1049,7 +1061,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1064,12 +1076,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 876fc1f78b4813..57d85478f48039 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3084,5 +3084,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index e5a2b61e0d9b52..590adf953259f3 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,23 +161,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -262,7 +262,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -300,7 +300,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -314,13 +314,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -328,7 +328,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -473,20 +473,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -547,13 +547,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -561,7 +561,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -625,7 +625,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -640,7 +640,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -655,12 +655,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -677,7 +677,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -741,7 +741,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -757,7 +757,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -766,13 +766,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -881,13 +889,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -895,7 +903,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -918,7 +926,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -928,7 +936,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -942,7 +950,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -950,14 +958,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1023,8 +1031,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1052,26 +1060,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1084,7 +1096,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1098,12 +1110,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1145,7 +1157,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1153,14 +1165,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1183,12 +1195,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1199,7 +1211,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1214,12 +1226,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1303,18 +1315,18 @@ server cluster FixedLabel = 64 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index 84f05af85b53d1..b5d2ed8cfb1508 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1952,7 +1952,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3516,5 +3516,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 774a44155a7f04..b3273daa5b68c6 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -154,7 +154,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -178,7 +178,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -245,7 +245,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -260,7 +260,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -275,12 +275,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -298,13 +298,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -319,7 +319,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -327,7 +327,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -383,7 +383,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -399,7 +399,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -408,13 +408,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -523,7 +531,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -533,7 +541,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -547,7 +555,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -555,14 +563,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -628,19 +636,19 @@ server cluster GeneralDiagnostics = 51 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -649,7 +657,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -659,7 +667,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -702,21 +710,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -729,7 +741,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -743,12 +755,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -790,7 +802,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -798,14 +810,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -828,12 +840,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -844,7 +856,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -859,12 +871,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -931,14 +943,14 @@ server cluster GroupKeyManagement = 63 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ server cluster OperationalState = 96 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kNoError = 0; kUnableToStartOrResume = 1; kUnableToCompleteOperation = 2; kCommandInvalidInState = 3; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kStopped = 0; kRunning = 1; kPaused = 2; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 7c0c25378d92b7..e50c640463cb6d 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -2399,7 +2399,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3517,5 +3517,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index c0d5c38342488d..db8fafe7e33ab9 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,7 +112,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -150,7 +150,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -164,13 +164,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -178,7 +178,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -236,7 +236,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -260,7 +260,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -323,20 +323,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -397,13 +397,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -411,7 +411,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -475,7 +475,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -490,7 +490,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -505,12 +505,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -527,7 +527,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -535,7 +535,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -591,7 +591,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -607,7 +607,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -616,13 +616,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -731,13 +739,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -745,7 +753,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -768,7 +776,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -778,7 +786,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -792,7 +800,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -800,14 +808,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -873,8 +881,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -902,26 +910,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -934,7 +946,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -948,12 +960,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -995,7 +1007,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1003,14 +1015,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1033,12 +1045,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1049,7 +1061,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1064,12 +1076,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1153,7 +1165,7 @@ server cluster FixedLabel = 64 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -1164,13 +1176,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -1179,20 +1191,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -1207,7 +1219,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -1217,7 +1229,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -1235,7 +1247,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -1245,21 +1257,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1268,7 +1280,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -1277,7 +1289,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -1291,7 +1303,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -1299,7 +1311,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -1307,7 +1319,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -1315,7 +1327,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -1328,13 +1340,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1347,7 +1359,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1357,19 +1369,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -1378,7 +1390,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1389,7 +1401,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1397,14 +1409,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -1418,7 +1430,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1428,13 +1440,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1444,7 +1456,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1454,7 +1466,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -1462,7 +1474,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1472,7 +1484,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index b7674880696e4f..6e55ee26b2f95c 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3413,5 +3413,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 49523746c44796..4055d3f91948f7 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,23 +161,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -262,7 +262,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -300,7 +300,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -314,13 +314,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -328,7 +328,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -473,20 +473,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -547,13 +547,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -561,7 +561,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -625,7 +625,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -640,7 +640,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -655,12 +655,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -677,7 +677,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -741,7 +741,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -757,7 +757,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -766,13 +766,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -881,13 +889,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -895,7 +903,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -918,7 +926,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -928,7 +936,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -942,7 +950,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -950,14 +958,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1023,8 +1031,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1052,26 +1060,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1084,7 +1096,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1098,12 +1110,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1145,7 +1157,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1153,14 +1165,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1183,12 +1195,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1199,7 +1211,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1214,12 +1226,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1303,53 +1315,53 @@ server cluster FixedLabel = 64 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1357,14 +1369,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 1b4f150a6ee06b..5d3000d8b3ab71 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4006,5 +4006,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index af74d9b8417c8f..37361893fd2449 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -462,7 +462,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -477,7 +477,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -492,12 +492,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -514,7 +514,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -522,7 +522,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -578,7 +578,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -594,7 +594,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -603,13 +603,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -718,13 +726,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -732,7 +740,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -755,7 +763,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -765,7 +773,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -779,7 +787,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -787,14 +795,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -860,8 +868,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -889,26 +897,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -921,7 +933,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -935,12 +947,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -982,7 +994,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -990,14 +1002,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1020,12 +1032,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1036,7 +1048,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1051,12 +1063,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1140,12 +1152,12 @@ server cluster FixedLabel = 64 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1155,7 +1167,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1164,12 +1176,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1178,13 +1190,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index a3a44938d440bc..6d93d50076731c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -1936,7 +1936,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2949,6 +2949,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -3226,5 +3227,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 4355a693b2445e..430af0dd820338 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 693dc2f4ddad58..3ad57c090834ff 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2986,5 +2986,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index edf34ad242a2da..3305b751649ce5 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -154,7 +154,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -178,7 +178,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -241,7 +241,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -249,7 +249,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -305,7 +305,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -321,7 +321,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -330,13 +330,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -445,13 +453,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -459,7 +467,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -482,7 +490,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -492,7 +500,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -506,7 +514,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -514,14 +522,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -589,7 +597,7 @@ server cluster GeneralDiagnostics = 51 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -639,21 +647,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -666,7 +678,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -680,12 +692,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -727,7 +739,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -735,14 +747,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -765,12 +777,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -781,7 +793,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -796,12 +808,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index 37347c96ac56ab..1f3613a429ed18 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2390,5 +2390,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index f2b3878dda758d..08aa21400773f2 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -157,23 +157,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -256,7 +256,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -294,7 +294,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -308,13 +308,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -322,7 +322,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -380,7 +380,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -404,7 +404,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -467,20 +467,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -541,13 +541,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -555,7 +555,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -619,7 +619,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -634,7 +634,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -649,12 +649,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -671,7 +671,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -679,7 +679,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -735,7 +735,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -751,7 +751,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -760,13 +760,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -875,13 +883,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -889,7 +897,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -912,7 +920,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -922,7 +930,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -936,7 +944,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -944,14 +952,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1017,8 +1025,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1046,26 +1054,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1078,7 +1090,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1092,12 +1104,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1139,7 +1151,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1147,14 +1159,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1177,12 +1189,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1193,7 +1205,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1208,12 +1220,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1297,13 +1309,13 @@ server cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ client cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -1312,13 +1324,13 @@ client cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -1330,7 +1342,7 @@ client cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1341,7 +1353,7 @@ client cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1351,7 +1363,7 @@ client cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -1454,12 +1466,12 @@ client cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1469,7 +1481,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1478,12 +1490,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1492,13 +1504,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index bc22535b084253..3995dfe9782e6a 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3377,6 +3377,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -3590,5 +3591,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 2fddc929581459..3078ca5196ed87 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index a46961552d7004..0e56fbaa2449b8 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2986,5 +2986,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index a4a7556ea57b0c..2e9b45c1f90b23 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -154,7 +154,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -178,7 +178,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -245,7 +245,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -260,7 +260,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -275,12 +275,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -298,13 +298,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -319,7 +319,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -327,7 +327,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -383,7 +383,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -399,7 +399,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -408,13 +408,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -523,7 +531,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -533,7 +541,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -547,7 +555,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -555,14 +563,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -628,19 +636,19 @@ server cluster GeneralDiagnostics = 51 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -649,7 +657,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -659,7 +667,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -702,21 +710,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -729,7 +741,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -743,12 +755,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -790,7 +802,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -798,14 +810,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -828,12 +840,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -844,7 +856,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -859,12 +871,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -931,14 +943,14 @@ server cluster GroupKeyManagement = 63 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ server cluster OperationalState = 96 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kNoError = 0; kUnableToStartOrResume = 1; kUnableToCompleteOperation = 2; kCommandInvalidInState = 3; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kStopped = 0; kRunning = 1; kPaused = 2; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 066606dffe2ca4..798ae3307bd2e0 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -2399,7 +2399,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3353,5 +3353,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index c045f9a0cf3add..6a9dd8678eaf30 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1159,7 +1171,7 @@ server cluster FixedLabel = 64 { /** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */ server cluster IlluminanceMeasurement = 1024 { - enum LightSensorTypeEnum : ENUM8 { + enum LightSensorTypeEnum : enum8 { kPhotodiode = 0; kCMOS = 1; } diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index 5331bdb29a7091..a33119d44de291 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2954,5 +2954,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 1e3b8a50836415..14000155c0a0bc 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1159,18 +1171,18 @@ server cluster FixedLabel = 64 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 27e62b5b70232a..6646443a09e65b 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2970,5 +2970,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 11dbf7f887a8fc..ca7dd727790bcc 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,23 +161,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -262,7 +262,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -300,7 +300,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -314,13 +314,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -328,7 +328,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -473,20 +473,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -547,13 +547,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -561,7 +561,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -625,7 +625,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -640,7 +640,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -655,12 +655,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -677,7 +677,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -741,7 +741,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -757,7 +757,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -766,13 +766,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -881,13 +889,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -895,7 +903,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -918,7 +926,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -928,7 +936,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -942,7 +950,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -950,14 +958,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1023,8 +1031,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1052,26 +1060,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1084,7 +1096,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1098,12 +1110,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1145,7 +1157,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1153,14 +1165,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1183,12 +1195,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1199,7 +1211,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1214,12 +1226,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index b59b25debe1562..e89d7311babe0a 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3426,5 +3426,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index a06418d6d3b914..85933c93474d4b 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,23 +161,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -262,7 +262,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -300,7 +300,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -314,13 +314,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -328,7 +328,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -473,20 +473,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -547,13 +547,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -561,7 +561,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -625,7 +625,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -640,7 +640,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -655,12 +655,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -677,7 +677,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -685,7 +685,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -741,7 +741,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -757,7 +757,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -766,13 +766,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -881,13 +889,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -895,7 +903,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -918,7 +926,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -928,7 +936,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -942,7 +950,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -950,14 +958,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1023,8 +1031,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1052,26 +1060,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1084,7 +1096,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1098,12 +1110,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1145,7 +1157,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1153,14 +1165,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1183,12 +1195,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1199,7 +1211,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1214,12 +1226,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 316cfd673f37eb..5b983849ca4f2f 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3558,5 +3558,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 29df2051187b2a..e226808c56b944 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,33 +181,33 @@ client cluster OnOff = 6 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -226,7 +226,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -264,7 +264,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -278,13 +278,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -292,7 +292,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -350,7 +350,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -374,7 +374,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -437,20 +437,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -511,13 +511,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -525,7 +525,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -589,7 +589,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -604,7 +604,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -619,12 +619,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -641,7 +641,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -649,7 +649,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -705,7 +705,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -721,7 +721,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -730,13 +730,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -845,13 +853,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -859,7 +867,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -882,7 +890,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -892,7 +900,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -906,7 +914,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -914,14 +922,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -987,8 +995,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1016,26 +1024,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1048,7 +1060,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1062,12 +1074,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1109,7 +1121,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1117,14 +1129,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1147,12 +1159,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1163,7 +1175,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1178,12 +1190,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index 05116b69ffb317..e2e1d77b241f90 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3146,5 +3146,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index bb008e5502862e..0a7f8aabd6adc2 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -161,7 +161,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -199,7 +199,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -213,13 +213,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -227,7 +227,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -285,7 +285,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -309,7 +309,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -372,20 +372,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -446,13 +446,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -460,7 +460,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -524,7 +524,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -539,7 +539,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -554,12 +554,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -576,7 +576,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -584,7 +584,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -640,7 +640,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -656,7 +656,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -665,13 +665,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -780,13 +788,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -794,7 +802,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -817,7 +825,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -827,7 +835,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -841,7 +849,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -849,14 +857,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -922,8 +930,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -951,26 +959,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -983,7 +995,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -997,12 +1009,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1044,7 +1056,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1052,14 +1064,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1082,12 +1094,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1098,7 +1110,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1113,12 +1125,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 37312157bc9ad5..24052570e77c22 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3174,5 +3174,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 3b413ff0c170a1..dd1a2f16349f05 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1175,7 +1187,7 @@ server cluster UserLabel = 65 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index af5ec16b4b5046..1b0028275e2b40 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2996,5 +2996,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 7ff08e6e8d9b44..a5bd2bf03297bb 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,33 +49,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -94,7 +94,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -127,13 +127,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -141,7 +141,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -199,7 +199,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -223,7 +223,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -282,7 +282,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -297,7 +297,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -312,12 +312,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -335,13 +335,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -355,7 +355,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -363,7 +363,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -419,7 +419,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -435,7 +435,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -444,13 +444,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -559,7 +567,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -569,7 +577,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -583,7 +591,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -591,14 +599,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -658,21 +666,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -685,7 +697,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -699,12 +711,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -746,7 +758,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -754,14 +766,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -784,12 +796,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -800,7 +812,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -815,12 +827,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -887,7 +899,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -896,14 +908,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -913,9 +925,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -998,9 +1010,9 @@ server cluster PumpConfigurationAndControl = 512 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1011,7 +1023,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index 6c364341345a4b..131da70f467974 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -1715,7 +1715,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3513,5 +3513,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 4676a684bbbc0f..44e81fb472dc0c 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,33 +49,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -94,7 +94,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -127,13 +127,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -141,7 +141,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -199,7 +199,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -223,7 +223,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -282,7 +282,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -297,7 +297,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -312,12 +312,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -335,13 +335,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -355,7 +355,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -363,7 +363,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -419,7 +419,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -435,7 +435,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -444,13 +444,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -559,7 +567,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -569,7 +577,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -583,7 +591,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -591,14 +599,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -658,21 +666,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -685,7 +697,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -699,12 +711,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -746,7 +758,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -754,14 +766,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -784,12 +796,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -800,7 +812,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -815,12 +827,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -887,7 +899,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -896,14 +908,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -913,9 +925,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index 1da6872a5c4c06..49a4e51fd9a20e 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -1715,7 +1715,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2971,5 +2971,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 2a4b5767b2adcd..745eb917c8b8bd 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -154,7 +154,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -178,7 +178,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -245,7 +245,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -260,7 +260,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -275,12 +275,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -298,13 +298,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -319,7 +319,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -327,7 +327,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -383,7 +383,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -399,7 +399,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -408,13 +408,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -523,7 +531,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -533,7 +541,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -547,7 +555,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -555,14 +563,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -628,19 +636,19 @@ server cluster GeneralDiagnostics = 51 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -649,7 +657,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -659,7 +667,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -702,21 +710,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -729,7 +741,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -743,12 +755,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -790,7 +802,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -798,14 +810,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -828,12 +840,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -844,7 +856,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -859,12 +871,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -931,7 +943,7 @@ server cluster GroupKeyManagement = 63 { /** Attributes and commands for configuring the temperature control, and reporting temperature. */ server cluster TemperatureControl = 86 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureNumber = 0x1; kTemperatureLevel = 0x2; kTemperatureStep = 0x4; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index e023f4be9a5cb3..6d0189f25a769a 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -2399,7 +2399,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3777,5 +3777,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index 789188da2eeeb9..a5a8b6afc1c7a0 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -116,131 +116,9 @@ server cluster Groups = 4 { fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; } -/** Attributes and commands for scene configuration and manipulation. */ -provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { - kSceneNames = 0x1; - kExplicit = 0x2; - kTableSize = 0x4; - kFabricScenes = 0x8; - } - - bitmap ScenesCopyMode : BITMAP8 { - kCopyAllScenes = 0x1; - } - - struct AttributeValuePair { - attrib_id attributeID = 0; - int32u attributeValue = 1; - } - - struct ExtensionFieldSet { - cluster_id clusterID = 0; - AttributeValuePair attributeValueList[] = 1; - } - - readonly attribute int8u sceneCount = 0; - readonly attribute int8u currentScene = 1; - readonly attribute group_id currentGroup = 2; - readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; - readonly attribute int16u sceneTableSize = 6; - readonly attribute int8u remainingCapacity = 7; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - int16u transitionTime = 2; - char_string sceneName = 3; - ExtensionFieldSet extensionFieldSets[] = 4; - } - - request struct ViewSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - } - - request struct RemoveSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - } - - request struct RemoveAllScenesRequest { - group_id groupID = 0; - } - - request struct StoreSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - } - - request struct RecallSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - optional nullable int16u transitionTime = 2; - } - - request struct GetSceneMembershipRequest { - group_id groupID = 0; - } - - response struct AddSceneResponse = 0 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - } - - response struct ViewSceneResponse = 1 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - optional int16u transitionTime = 3; - optional char_string sceneName = 4; - optional ExtensionFieldSet extensionFieldSets[] = 5; - } - - response struct RemoveSceneResponse = 2 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - } - - response struct RemoveAllScenesResponse = 3 { - status status = 0; - group_id groupID = 1; - } - - response struct StoreSceneResponse = 4 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - } - - response struct GetSceneMembershipResponse = 6 { - status status = 0; - nullable int8u capacity = 1; - group_id groupID = 2; - optional int8u sceneList[] = 3; - } - - fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; - fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; - fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; - fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; - fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; - fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; - fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -273,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -287,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -345,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -369,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -432,7 +310,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -440,7 +318,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -496,7 +374,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -512,7 +390,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -521,13 +399,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -636,13 +522,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -650,7 +536,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -673,7 +559,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -683,7 +569,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -697,7 +583,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -705,14 +591,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -778,21 +664,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -805,7 +695,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -819,12 +709,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -866,7 +756,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -874,14 +764,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -904,12 +794,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -920,7 +810,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -935,12 +825,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1007,12 +897,12 @@ server cluster GroupKeyManagement = 63 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcRunMode = 84 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kIdle = 16384; kCleaning = 16385; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kStuck = 65; kDustBinMissing = 66; kDustBinFull = 67; @@ -1023,7 +913,7 @@ server cluster RvcRunMode = 84 { kBatteryLow = 72; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -1040,7 +930,6 @@ server cluster RvcRunMode = 84 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute nullable int8u startUpMode = 2; attribute nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1063,17 +952,17 @@ server cluster RvcRunMode = 84 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcCleanMode = 85 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kDeepClean = 16384; kVacuum = 16385; kMop = 16386; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kCleaningInProgress = 64; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -1090,7 +979,6 @@ server cluster RvcCleanMode = 85 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute nullable int8u startUpMode = 2; attribute nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1113,7 +1001,7 @@ server cluster RvcCleanMode = 85 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ server cluster RvcOperationalState = 97 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kFailedToFindChargingDock = 64; kStuck = 65; kDustBinMissing = 66; @@ -1124,7 +1012,7 @@ server cluster RvcOperationalState = 97 { kMopCleaningPadMissing = 71; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kSeekingCharger = 64; kCharging = 65; kDocked = 66; @@ -1380,36 +1268,6 @@ endpoint 1 { handle command AddGroupIfIdentifying; } - server cluster Scenes { - callback attribute sceneCount default = 0x00; - ram attribute currentScene default = 0x00; - ram attribute currentGroup default = 0x0000; - ram attribute sceneValid default = 0x00; - ram attribute nameSupport default = 0x00; - ram attribute sceneTableSize; - callback attribute remainingCapacity; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 5; - - handle command AddScene; - handle command AddSceneResponse; - handle command ViewScene; - handle command ViewSceneResponse; - handle command RemoveScene; - handle command RemoveSceneResponse; - handle command RemoveAllScenes; - handle command RemoveAllScenesResponse; - handle command StoreScene; - handle command StoreSceneResponse; - handle command RecallScene; - handle command GetSceneMembership; - handle command GetSceneMembershipResponse; - } - server cluster Descriptor { callback attribute deviceTypeList default = 0; callback attribute serverList default = 0; @@ -1426,14 +1284,13 @@ endpoint 1 { server cluster RvcRunMode { callback attribute supportedModes default = 0; callback attribute currentMode default = 0; - callback attribute startUpMode default = 0; callback attribute onMode default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -1442,14 +1299,13 @@ endpoint 1 { server cluster RvcCleanMode { callback attribute supportedModes default = 0; callback attribute currentMode default = 0; - callback attribute startUpMode default = 0; callback attribute onMode default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index 5c1ac4df4af665..dad96cd186033a 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2259,330 +2259,6 @@ } ] }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "AddSceneResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "ViewSceneResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "SceneCount", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentScene", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "CurrentGroup", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "group_id", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SceneValid", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SceneTableSize", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "RemainingCapacity", - "code": 7, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "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": "5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -2811,22 +2487,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "OnMode", "code": 3, @@ -2933,7 +2593,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2999,22 +2659,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "OnMode", "code": 3, @@ -3121,7 +2765,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3391,5 +3035,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 29941df8ef18b5..3f2fb5857276cc 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -163,7 +163,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -196,13 +196,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -210,7 +210,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -268,7 +268,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -292,7 +292,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -355,7 +355,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -363,7 +363,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -419,7 +419,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -435,7 +435,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -444,13 +444,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -559,13 +567,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -573,7 +581,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -596,7 +604,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -606,7 +614,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -620,7 +628,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -628,14 +636,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -701,21 +709,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -728,7 +740,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -742,12 +754,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -789,7 +801,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -797,14 +809,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -827,12 +839,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -843,7 +855,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -858,12 +870,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -930,13 +942,13 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -945,13 +957,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -963,7 +975,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -974,7 +986,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -984,7 +996,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -1020,12 +1032,12 @@ server cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1035,7 +1047,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1044,12 +1056,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1058,13 +1070,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index 11fde93ff66874..81b7dd94bb90f1 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2812,6 +2812,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -3131,5 +3132,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index c26a09fcff0575..1c026bb8c31c30 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,7 +310,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -346,7 +346,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -360,20 +360,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -457,38 +457,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -542,7 +542,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -550,7 +550,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -606,7 +606,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -622,7 +622,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -631,13 +631,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -746,13 +754,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -760,7 +768,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -783,7 +791,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -793,7 +801,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -807,7 +815,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -815,14 +823,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -888,21 +896,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -915,7 +927,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -929,12 +941,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -976,7 +988,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -984,14 +996,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1014,12 +1026,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1030,7 +1042,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1045,12 +1057,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1117,25 +1129,25 @@ server cluster GroupKeyManagement = 63 { /** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */ server cluster SmokeCoAlarm = 92 { - enum AlarmStateEnum : ENUM8 { + enum AlarmStateEnum : enum8 { kNormal = 0; kWarning = 1; kCritical = 2; } - enum ContaminationStateEnum : ENUM8 { + enum ContaminationStateEnum : enum8 { kNormal = 0; kLow = 1; kWarning = 2; kCritical = 3; } - enum EndOfServiceEnum : ENUM8 { + enum EndOfServiceEnum : enum8 { kNormal = 0; kExpired = 1; } - enum ExpressedStateEnum : ENUM8 { + enum ExpressedStateEnum : enum8 { kNormal = 0; kSmokeAlarm = 1; kCOAlarm = 2; @@ -1147,18 +1159,18 @@ server cluster SmokeCoAlarm = 92 { kInterconnectCO = 8; } - enum MuteStateEnum : ENUM8 { + enum MuteStateEnum : enum8 { kNotMuted = 0; kMuted = 1; } - enum SensitivityEnum : ENUM8 { + enum SensitivityEnum : enum8 { kHigh = 0; kStandard = 1; kLow = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSmokeAlarm = 0x1; kCOAlarm = 0x2; } @@ -1212,7 +1224,7 @@ server cluster SmokeCoAlarm = 92 { readonly attribute AlarmStateEnum interconnectSmokeAlarm = 8; readonly attribute AlarmStateEnum interconnectCOAlarm = 9; readonly attribute ContaminationStateEnum contaminationState = 10; - attribute SensitivityEnum smokeSensitivityLevel = 11; + attribute access(write: manage) SensitivityEnum smokeSensitivityLevel = 11; readonly attribute epoch_s expiryDate = 12; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index fcf0eee0d0899e..ac52e9a00e295e 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3069,5 +3069,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index a709b5f8575567..5fc393ff48f607 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,33 +43,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -88,23 +88,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -187,7 +187,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -225,7 +225,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -239,13 +239,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -253,7 +253,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -311,7 +311,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -335,7 +335,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -398,20 +398,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -472,13 +472,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -486,7 +486,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -550,7 +550,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -565,7 +565,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -580,12 +580,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -602,7 +602,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -610,7 +610,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -666,7 +666,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -682,7 +682,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -691,13 +691,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -806,13 +814,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -820,7 +828,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -843,7 +851,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -853,7 +861,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -867,7 +875,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -875,14 +883,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -948,8 +956,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -977,26 +985,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1009,7 +1021,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1023,12 +1035,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1070,7 +1082,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1078,14 +1090,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1108,12 +1120,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1124,7 +1136,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1139,12 +1151,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index db7ccef40802e4..dd5e63a06d5bfd 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3158,5 +3158,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 8386f1ea117b34..8eb9c77b6fc45e 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ client cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ client cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -76,7 +76,7 @@ client cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } request struct GetGroupMembershipRequest { @@ -99,7 +99,7 @@ client cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } /** Command description for AddGroup */ @@ -118,7 +118,7 @@ client cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -329,20 +329,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -403,13 +403,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -417,7 +417,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -481,7 +481,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -496,7 +496,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -511,12 +511,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -533,7 +533,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -541,7 +541,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -597,7 +597,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -613,7 +613,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -622,13 +622,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -737,13 +745,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -751,7 +759,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -774,7 +782,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -784,7 +792,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -798,7 +806,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -806,14 +814,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -879,8 +887,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -908,26 +916,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -940,7 +952,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -954,12 +966,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1001,7 +1013,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1009,14 +1021,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1039,12 +1051,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1055,7 +1067,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1070,12 +1082,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1159,9 +1171,9 @@ server cluster FixedLabel = 64 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index b4eb2d40ed3c26..28e1691e0d9387 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2970,5 +2970,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 57b611204f1081..73d5d7df7262a2 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,7 +112,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -150,7 +150,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -164,13 +164,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -178,7 +178,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -236,7 +236,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -260,7 +260,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -323,20 +323,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -397,13 +397,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -411,7 +411,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -475,7 +475,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -490,7 +490,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -505,12 +505,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -527,7 +527,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -535,7 +535,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -591,7 +591,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -607,7 +607,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -616,13 +616,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -731,13 +739,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -745,7 +753,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -768,7 +776,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -778,7 +786,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -792,7 +800,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -800,14 +808,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -873,8 +881,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -902,26 +910,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -934,7 +946,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -948,12 +960,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -995,7 +1007,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1003,14 +1015,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1033,12 +1045,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1049,7 +1061,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1064,12 +1076,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1153,13 +1165,13 @@ server cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -1168,13 +1180,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -1186,7 +1198,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1197,7 +1209,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1207,7 +1219,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -1262,12 +1274,12 @@ server cluster Thermostat = 513 { /** An interface for controlling a fan in a heating/cooling system. */ provisional client cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1277,7 +1289,7 @@ provisional client cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1286,12 +1298,12 @@ provisional client cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1300,13 +1312,13 @@ provisional client cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } @@ -1354,10 +1366,10 @@ server cluster ThermostatUserInterfaceConfiguration = 516 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ client cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute optional int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute optional temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1382,18 +1394,18 @@ client cluster RelativeHumidityMeasurement = 1029 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index fa3cecef5e5301..fc6192274b30ac 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3499,6 +3499,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -3800,5 +3801,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 8ff26857500aae..7a1f5a750e1747 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,7 +112,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -150,7 +150,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -164,13 +164,13 @@ client cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -178,7 +178,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -236,7 +236,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -260,7 +260,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -323,20 +323,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -397,13 +397,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -411,7 +411,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -475,7 +475,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -490,7 +490,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -505,12 +505,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -527,7 +527,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -535,7 +535,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -591,7 +591,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -607,7 +607,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -616,13 +616,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -731,13 +739,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -745,7 +753,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -768,7 +776,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -778,7 +786,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -792,7 +800,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -800,14 +808,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -873,8 +881,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -902,26 +910,30 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -934,7 +946,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -948,12 +960,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -995,7 +1007,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1003,14 +1015,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1033,12 +1045,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1049,7 +1061,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1064,12 +1076,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1153,7 +1165,7 @@ server cluster FixedLabel = 64 { /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -1181,7 +1193,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -1195,7 +1207,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -1205,7 +1217,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -1213,20 +1225,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index ddc252e56b669c..981a417a84f735 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -1920,7 +1920,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3462,5 +3462,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index 4f8c011c1e12b8..0f7cf1a1d63a13 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -1876,14 +1876,14 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 0, + "code": 4293984259, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" }, "deviceTypes": [ { - "code": 0, + "code": 4293984259, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" @@ -1893,10 +1893,10 @@ 1 ], "deviceIdentifiers": [ - 0 + 4293984259 ], "deviceTypeName": "MA-all-clusters-app", - "deviceTypeCode": 0, + "deviceTypeCode": 4293984259, "deviceTypeProfileId": 259, "clusters": [ { @@ -1989,6 +1989,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -2177,6 +2193,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -2234,6 +2266,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -2485,6 +2518,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -2639,6 +2688,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -2707,5 +2772,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/chef/silabs/include/CHIPProjectConfig.h b/examples/chef/silabs/include/CHIPProjectConfig.h index 75c8d194f8f319..3d58f864782be3 100644 --- a/examples/chef/silabs/include/CHIPProjectConfig.h +++ b/examples/chef/silabs/include/CHIPProjectConfig.h @@ -120,5 +120,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index d52ce7446f12ed..7722f26a11d96e 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) @@ -76,8 +74,10 @@ target_include_directories(app PRIVATE ${GEN_DIR}/../ ${CHIP_ROOT}/src ${CHEF}/shell_common/include + ${CHEF}/telink/include ${TELINK_COMMON}/common/include ${TELINK_COMMON}/util/include + ${TELINK_COMMON}/app/include ) if (CONFIG_CHIP_LIB_SHELL) @@ -97,7 +97,12 @@ add_definitions( ) target_sources(app PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp + src/AppTask.cpp + ${TELINK_COMMON}/common/src/mainCommon.cpp + ${TELINK_COMMON}/common/src/AppTaskCommon.cpp + ${TELINK_COMMON}/util/src/PWMDevice.cpp + ${TELINK_COMMON}/util/src/ButtonManager.cpp + ${TELINK_COMMON}/util/src/ThreadUtil.cpp ${CHEF}/common/stubs.cpp ) diff --git a/examples/chef/telink/include/AppConfig.h b/examples/chef/telink/include/AppConfig.h new file mode 100644 index 00000000000000..e5c7b0417ef160 --- /dev/null +++ b/examples/chef/telink/include/AppConfig.h @@ -0,0 +1,28 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// ---- Chef Example App Config ---- + +#define APP_USE_EXAMPLE_START_BUTTON 0 +#define APP_USE_BLE_START_BUTTON 1 +#define APP_USE_THREAD_START_BUTTON 1 +#define APP_SET_DEVICE_INFO_PROVIDER 1 +#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 0 +#define APP_USE_IDENTIFY_PWM 0 diff --git a/examples/chef/telink/include/AppTask.h b/examples/chef/telink/include/AppTask.h new file mode 100644 index 00000000000000..3b91e9a3733786 --- /dev/null +++ b/examples/chef/telink/include/AppTask.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "AppTaskCommon.h" + +class AppTask : public AppTaskCommon +{ +public: +private: + friend AppTask & GetAppTask(void); + friend class AppTaskCommon; + + CHIP_ERROR Init(void); + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/chef/telink/main.cpp b/examples/chef/telink/main.cpp deleted file mode 100644 index 088dd22a481063..00000000000000 --- a/examples/chef/telink/main.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include - -#include "platform/CHIPDeviceLayer.h" -#include - -#include -#include - -#include -#include - -#if CONFIG_ENABLE_CHIP_SHELL || CONFIG_CHIP_LIB_SHELL -#include -#endif - -#ifdef CONFIG_ENABLE_PW_RPC -#include "Rpc.h" -#endif - -LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); - -using namespace chip; -using namespace chip::Shell; -using namespace chip::DeviceLayer; - -int main() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - -#ifdef CONFIG_ENABLE_PW_RPC - rpc::Init(); -#endif - err = chip::Platform::MemoryInit(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Platform::MemoryInit() failed"); - return 1; - } - err = PlatformMgr().InitChipStack(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "PlatformMgr().InitChipStack() failed"); - return 1; - } - - // Network connectivity -#if CHIP_DEVICE_CONFIG_ENABLE_WPA - ConnectivityManagerImpl().StartWiFiManagement(); -#endif - -#if defined(CHIP_ENABLE_OPENTHREAD) - err = ThreadStackMgr().InitThreadStack(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ThreadStackMgr().InitThreadStack() failed"); - return 1; - } - -#if defined(CONFIG_CHIP_THREAD_DEVICE_ROLE_ROUTER) - err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); -#elif defined(CONFIG_CHIP_THREAD_DEVICE_ROLE_END_DEVICE) - err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); -#elif defined(CONFIG_CHIP_THREAD_DEVICE_ROLE_SLEEPY_END_DEVICE) - err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); -#else -#error THREAD_DEVICE_ROLE not selected -#endif - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConnectivityMgr().SetThreadDeviceType() failed"); - return 1; - } -#endif - - // Device Attestation & Onboarding codes - chip::Credentials::SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); -#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY - chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(kExtDiscoveryTimeoutSecs); -#endif /* CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY */ - - // Start IM server - static chip::CommonCaseDeviceServerInitParams initParams; - (void) initParams.InitializeStaticResourcesBeforeServerInit(); - err = chip::Server::GetInstance().Init(initParams); - if (err != CHIP_NO_ERROR) - { - return 1; - } - - chip::DeviceLayer::ConfigurationMgr().LogDeviceConfig(); - - err = chip::DeviceLayer::PlatformMgr().StartEventLoopTask(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "PlatformMgr().StartEventLoopTask() failed"); - } - - // When SoftAP support becomes available, it should be added here. -#if CONFIG_NETWORK_LAYER_BLE - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); -#else - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork)); -#endif /* CONFIG_NETWORK_LAYER_BLE */ - - // Starts commissioning window automatically. Starts BLE advertising when BLE enabled - if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "OpenBasicCommissioningWindow() failed"); - } - -#if CONFIG_CHIP_LIB_SHELL - int rc = Engine::Root().Init(); - if (rc != 0) - { - ChipLogError(AppServer, "Streamer initialization failed: %d", rc); - return 1; - } - - cmd_misc_init(); - cmd_otcli_init(); -#endif - -#if CHIP_SHELL_ENABLE_CMD_SERVER - cmd_app_server_init(); -#endif - -#if CONFIG_CHIP_LIB_SHELL - Engine::Root().RunMainLoop(); -#endif - - return 0; -} diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index b5986b7d07a5bc..9b99b6a3fcc40c 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -55,3 +55,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n # Enable Power Management CONFIG_PM=n + +CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=n diff --git a/examples/chef/telink/src/AppTask.cpp b/examples/chef/telink/src/AppTask.cpp new file mode 100644 index 00000000000000..a9683f0d8c3610 --- /dev/null +++ b/examples/chef/telink/src/AppTask.cpp @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::Init(void) +{ + InitCommonParts(); + +#if CONFIG_CHIP_LIB_SHELL + int rc = Engine::Root().Init(); + if (rc != 0) + { + ChipLogError(AppServer, "Streamer initialization failed: %d", rc); + return 1; + } + + cmd_misc_init(); + cmd_otcli_init(); +#endif + +#if CHIP_SHELL_ENABLE_CMD_SERVER + cmd_app_server_init(); +#endif + +#if CONFIG_CHIP_LIB_SHELL + Engine::Root().RunMainLoop(); +#endif + + return CHIP_NO_ERROR; +} diff --git a/examples/chip-tool/commands/clusters/JsonParser.h b/examples/chip-tool/commands/clusters/JsonParser.h index adb1375bd880d1..9f13c3be8914a7 100644 --- a/examples/chip-tool/commands/clusters/JsonParser.h +++ b/examples/chip-tool/commands/clusters/JsonParser.h @@ -130,6 +130,7 @@ class JsonParser private: static void LogErrorLocation(chip::Optional & errorColumn, const char * json) { +#if CHIP_ERROR_LOGGING if (!errorColumn.HasValue()) { return; @@ -160,5 +161,6 @@ class JsonParser errorMarker += "^"; ChipLogError(chipTool, "%s", errorMarker.c_str()); errorColumn.ClearValue(); +#endif // CHIP_ERROR_LOGGING } }; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 2b972c0f9799d1..2d0308f0c81741 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -462,7 +462,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -477,7 +477,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -492,12 +492,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -514,7 +514,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -522,7 +522,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -578,7 +578,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -594,7 +594,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -603,13 +603,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -718,13 +726,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -732,7 +740,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -755,7 +763,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -765,7 +773,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -779,7 +787,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -787,14 +795,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -860,8 +868,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -889,24 +897,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -916,7 +924,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1057,19 +1065,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1078,7 +1086,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1088,7 +1096,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1131,7 +1139,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1144,7 +1152,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1165,26 +1173,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1197,7 +1209,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1211,12 +1223,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1258,7 +1270,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1266,14 +1278,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1296,12 +1308,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1312,7 +1324,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1327,12 +1339,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1447,18 +1459,18 @@ server cluster BooleanState = 69 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 64a677860d5b0c..0fa6b11ed229eb 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -3599,7 +3599,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4698,5 +4698,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index cef7f3364dd7dd..370ffbdee63a7f 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h index 053d8c04247493..a262c1a3537c33 100644 --- a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h @@ -22,24 +22,15 @@ #include #include -NS_ASSUME_NONNULL_BEGIN -@interface MTRDeviceTestDelegate : NSObject -@property CHIPCommandBridge * commandBridge; -- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge; -- (instancetype)init NS_UNAVAILABLE; -@end -NS_ASSUME_NONNULL_END - -class WaitForCommissioneeCommand : public CHIPCommandBridge { +class WaitForCommissioneeCommand : public CHIPCommandBridge +{ public: - WaitForCommissioneeCommand() - : CHIPCommandBridge("wait-for-commissionee") - , mDeviceDelegate([[MTRDeviceTestDelegate alloc] initWithCommandBridge:this]) + WaitForCommissioneeCommand() : CHIPCommandBridge("wait-for-commissionee") { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("expire-existing-session", 0, 1, &mExpireExistingSession); - AddArgument( - "timeout", 0, UINT64_MAX, &mTimeoutSecs, "Time, in seconds, before this command is considered to have timed out."); + AddArgument("timeout", 0, UINT64_MAX, &mTimeoutSecs, + "Time, in seconds, before this command is considered to have timed out."); } /////////// CHIPCommandBridge Interface ///////// @@ -53,5 +44,4 @@ class WaitForCommissioneeCommand : public CHIPCommandBridge { chip::NodeId mNodeId; chip::Optional mTimeoutSecs; chip::Optional mExpireExistingSession; - id _Nullable mDeviceDelegate; }; diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm index a806757ac1eb85..6bc25defa21d1a 100644 --- a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm @@ -20,43 +20,10 @@ #import "MTRDevice_Externs.h" -@implementation MTRDeviceTestDelegate -- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge -{ - if (!(self = [super init])) { - return nil; - } - - _commandBridge = commandBridge; - return self; -} - -- (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state -{ - if (state == MTRDeviceStateReachable) { - _commandBridge->SetCommandExitStatus(CHIP_NO_ERROR); - } else if (state == MTRDeviceStateUnreachable) { - _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); - } else if (state == MTRDeviceStateUnknown) { - _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); - } else { - // This should not happens. - chipDie(); - } -} - -- (void)device:(MTRDevice *)device receivedAttributeReport:(NSArray *> *)attributeReport -{ -} - -- (void)device:(MTRDevice *)device receivedEventReport:(NSArray *> *)eventReport -{ -} -@end - CHIP_ERROR WaitForCommissioneeCommand::RunCommand() { MTRDeviceController * commissioner = CurrentCommissioner(); + VerifyOrReturnError(nil != commissioner, CHIP_ERROR_INCORRECT_STATE); auto * base_device = [MTRBaseDevice deviceWithNodeID:@(mNodeId) controller:commissioner]; VerifyOrReturnError(base_device != nil, CHIP_ERROR_INCORRECT_STATE); @@ -64,13 +31,7 @@ - (void)device:(MTRDevice *)device receivedEventReport:(NSArray groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -156,7 +156,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -170,13 +170,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -184,7 +184,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -242,7 +242,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -266,7 +266,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -333,7 +333,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -348,7 +348,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -363,12 +363,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -386,13 +386,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -407,7 +407,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -415,7 +415,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -471,7 +471,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -487,7 +487,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -496,13 +496,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -611,7 +619,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -621,7 +629,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -635,7 +643,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -643,14 +651,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -716,19 +724,19 @@ server cluster GeneralDiagnostics = 51 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -737,7 +745,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -747,7 +755,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -790,21 +798,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -817,7 +829,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -831,12 +843,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -878,7 +890,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -886,14 +898,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -916,12 +928,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -932,7 +944,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -947,12 +959,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1019,14 +1031,14 @@ server cluster GroupKeyManagement = 63 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ server cluster OperationalState = 96 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kNoError = 0; kUnableToStartOrResume = 1; kUnableToCompleteOperation = 2; kCommandInvalidInState = 3; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kStopped = 0; kRunning = 1; kPaused = 2; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index 12ec8977ca97de..35e670751458f5 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -2539,7 +2539,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3903,5 +3903,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/kotlin-matter-controller/args.gni b/examples/kotlin-matter-controller/args.gni index 9b0c312fbdc837..3a0049f5f90de7 100644 --- a/examples/kotlin-matter-controller/args.gni +++ b/examples/kotlin-matter-controller/args.gni @@ -24,3 +24,4 @@ chip_project_config_include_dirs = [ "${chip_root}/examples/kotlin-matter-controller/include" ] chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] chip_stack_lock_tracking = "fatal" +chip_build_controller_dynamic_server = true diff --git a/examples/light-switch-app/ameba/README.md b/examples/light-switch-app/ameba/README.md index 67ed7c829c50f1..835b11ea444c59 100644 --- a/examples/light-switch-app/ameba/README.md +++ b/examples/light-switch-app/ameba/README.md @@ -26,11 +26,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 - Setup build environment: 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 f703cbfc4860b7..f8962a2ac437d7 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 @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ client cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -51,7 +51,7 @@ client cluster Identify = 3 { /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -60,11 +60,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -97,11 +97,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -115,7 +115,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -132,7 +132,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -143,7 +143,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -166,14 +166,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional client cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -344,33 +344,33 @@ provisional client cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -413,7 +413,7 @@ client cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -451,7 +451,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -465,13 +465,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -479,7 +479,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -537,7 +537,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -561,7 +561,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -624,20 +624,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -698,13 +698,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -712,7 +712,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -776,7 +776,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -791,7 +791,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -806,12 +806,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -828,7 +828,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -836,7 +836,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -892,7 +892,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -908,7 +908,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -917,13 +917,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1032,13 +1040,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1046,7 +1054,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1069,7 +1077,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1079,7 +1087,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1093,7 +1101,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1101,14 +1109,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1174,8 +1182,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1203,24 +1211,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1230,7 +1238,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1371,19 +1379,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1392,7 +1400,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1402,7 +1410,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1445,7 +1453,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1458,7 +1466,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1479,12 +1487,12 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */ server cluster TimeSynchronization = 56 { - enum GranularityEnum : ENUM8 { + enum GranularityEnum : enum8 { kNoTimeGranularity = 0; kMinutesGranularity = 1; kSecondsGranularity = 2; @@ -1492,11 +1500,11 @@ server cluster TimeSynchronization = 56 { kMicrosecondsGranularity = 4; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kTimeNotAccepted = 2; } - enum TimeSourceEnum : ENUM8 { + enum TimeSourceEnum : enum8 { kNone = 0; kUnknown = 1; kAdmin = 2; @@ -1516,13 +1524,13 @@ server cluster TimeSynchronization = 56 { kGNSS = 16; } - enum TimeZoneDatabaseEnum : ENUM8 { + enum TimeZoneDatabaseEnum : enum8 { kFull = 0; kPartial = 1; kNone = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTimeZone = 0x1; kNTPClient = 0x2; kNTPServer = 0x4; @@ -1626,7 +1634,7 @@ server cluster TimeSynchronization = 56 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1676,21 +1684,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1703,7 +1715,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1717,12 +1729,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1764,7 +1776,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1772,14 +1784,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1802,12 +1814,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1818,7 +1830,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1833,12 +1845,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1938,8 +1950,30 @@ server cluster UserLabel = 65 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; } fabric_scoped struct MonitoringRegistrationStruct { @@ -1948,8 +1982,8 @@ server cluster IcdManagement = 70 { fabric_idx fabricIndex = 254; } - readonly attribute int32u idleModeInterval = 0; - readonly attribute int32u activeModeInterval = 1; + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; readonly attribute int16u activeModeThreshold = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1961,53 +1995,53 @@ server cluster IcdManagement = 70 { /** Attributes and commands for controlling the color properties of a color-capable light. */ client cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -2015,14 +2049,14 @@ client cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2647,11 +2681,11 @@ endpoint 0 { } server cluster IcdManagement { - callback attribute idleModeInterval default = 500; - callback attribute activeModeInterval default = 300; + callback attribute idleModeDuration default = 500; + callback attribute activeModeDuration default = 300; callback attribute activeModeThreshold default = 300; ram attribute featureMap default = 0x0000; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } } endpoint 1 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 073f9a677e102e..a92321ae63ca0c 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -3886,7 +3886,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4448,7 +4448,7 @@ "enabled": 1, "attributes": [ { - "name": "IdleModeInterval", + "name": "IdleModeDuration", "code": 0, "mfgCode": null, "side": "server", @@ -4464,7 +4464,7 @@ "reportableChange": 0 }, { - "name": "ActiveModeInterval", + "name": "ActiveModeDuration", "code": 1, "mfgCode": null, "side": "server", @@ -4521,7 +4521,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4839,6 +4839,7 @@ "define": "SCENES_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -5831,5 +5832,6 @@ "endpointId": 2, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/light-switch-app/nrfconnect/main/include/AppTask.h b/examples/light-switch-app/nrfconnect/main/include/AppTask.h index ebff88838b1d82..c4018152e23da5 100644 --- a/examples/light-switch-app/nrfconnect/main/include/AppTask.h +++ b/examples/light-switch-app/nrfconnect/main/include/AppTask.h @@ -37,13 +37,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance() { static AppTask sAppTask; diff --git a/examples/light-switch-app/silabs/include/CHIPProjectConfig.h b/examples/light-switch-app/silabs/include/CHIPProjectConfig.h index 3141defe9c5133..59aa54b25a0eb1 100644 --- a/examples/light-switch-app/silabs/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/silabs/include/CHIPProjectConfig.h @@ -100,5 +100,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 6dc9970c5c732e..562be75144d584 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -26,7 +26,7 @@ creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/lighting-app/ameba/README.md b/examples/lighting-app/ameba/README.md index e81705889be1a9..012ac3b89be5da 100644 --- a/examples/lighting-app/ameba/README.md +++ b/examples/lighting-app/ameba/README.md @@ -23,11 +23,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 - Setup build environment: diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index c3938d819c5ec8..83ff6a87b6a0f4 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -80,31 +80,33 @@ Mac OS. ## Build CHIP Lighting App example -The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, BL706 -develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . +The following steps take examples for `BL602-IoT-Matter-V1` BL602 board, +`BL706DK` BL706 board, and `BL704LDK` BL704L board . - Build lighting app with UART baudrate 2000000 ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build - ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build ``` - Build lighting app with UART baudrate 115200 ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200 build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-115200 build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-115200 build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-115200 build ``` - Build lighting app with RPC enabled and UART baudrate 115200. ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-rpc build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-rpc build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-rpc build ``` ### Build options with build_examples.py @@ -127,6 +129,10 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . application. - `-thread`, to specify that connectivity Thread is enabled for Matter application. +- `-mot`, to specify to use openthread stack under + `third_party/openthread/repo` + - Without `-mot` specified, Matter Thread will use openthread stack under + `Bouffalo Lab` SDK - `-fp`, to specify to enable frame pointer feature to print call stack when hit an exception for debug purpose. @@ -161,19 +167,19 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . - Type following command for image download. Please set serial port accordingly, here we use /dev/ttyACM0 as a serial port example. - - `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without - additional build options + - `bl602-iot-matter-v1`, `bl706dk` and `bl704ldk` without additional + build options ```shell ./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 ``` - - `xt-zb6-devkit` with 115200 baudrate setting + - `bl706dk` with 115200 baudrate setting ```shell - ./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ``` - To wipe out flash and download image, please append `--erase` to the @@ -181,7 +187,7 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . ```shell ./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 --erase - ./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase + ./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 --erase ``` diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 7d6ae4db39c8f2..fa863ceaf699d3 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -216,14 +216,14 @@ bouffalolab_executable("lighting_app") { if (chip_openthread_ftd) { defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", ] } else { defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", ] } } diff --git a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn index c21ffe472b5a7b..a3f4e3120e8092 100644 --- a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn @@ -170,14 +170,14 @@ bouffalolab_executable("lighting_app") { if (chip_openthread_ftd) { defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", ] } else { defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${openthread_root}:libopenthread-cli-mtd", + "${openthread_root}:libopenthread-mtd", ] } } diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 2c8a5aa2f0f576..8ab0257efa2b41 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -289,7 +289,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -322,13 +322,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -336,7 +336,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -394,7 +394,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -418,7 +418,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -481,20 +481,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -555,13 +555,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -569,7 +569,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -633,7 +633,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -648,7 +648,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -663,12 +663,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -685,7 +685,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -693,7 +693,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -749,7 +749,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -765,7 +765,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -774,13 +774,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -889,13 +897,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -903,7 +911,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -926,7 +934,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -936,7 +944,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -950,7 +958,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -958,14 +966,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1031,8 +1039,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1059,12 +1067,12 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1077,7 +1085,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1098,26 +1106,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1130,7 +1142,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1144,12 +1156,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1191,7 +1203,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1199,14 +1211,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1229,12 +1241,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1245,7 +1257,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1260,12 +1272,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1365,53 +1377,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1419,14 +1431,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 218ddb42e801af..3fbf144422e576 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -2015,7 +2015,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4277,5 +4277,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 510c773e12ad24..f7bb7e5544d04e 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -289,7 +289,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -322,13 +322,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -336,7 +336,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -394,7 +394,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -418,7 +418,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -481,20 +481,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -555,13 +555,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -569,7 +569,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -633,7 +633,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -648,7 +648,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -663,12 +663,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -685,7 +685,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -693,7 +693,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -749,7 +749,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -765,7 +765,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -774,13 +774,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -889,13 +897,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -903,7 +911,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -926,7 +934,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -936,7 +944,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -950,7 +958,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -958,14 +966,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1031,8 +1039,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1060,24 +1068,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1087,7 +1095,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1226,21 +1234,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1253,7 +1265,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1267,12 +1279,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1314,7 +1326,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1322,14 +1334,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1352,12 +1364,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1368,7 +1380,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1383,12 +1395,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1488,53 +1500,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1542,14 +1554,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 3f540ed9f04d31..cb06c41a042700 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -2991,7 +2991,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5253,5 +5253,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 40ece2592cb11d..98e9f875aebe99 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -289,7 +289,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -322,13 +322,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -336,7 +336,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -394,7 +394,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -418,7 +418,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -481,20 +481,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -555,13 +555,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -569,7 +569,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -633,7 +633,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -648,7 +648,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -663,12 +663,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -685,7 +685,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -693,7 +693,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -749,7 +749,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -765,7 +765,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -774,13 +774,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -889,13 +897,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -903,7 +911,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -926,7 +934,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -936,7 +944,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -950,7 +958,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -958,14 +966,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1031,8 +1039,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1059,24 +1067,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1085,7 +1093,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1095,7 +1103,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1136,21 +1144,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1163,7 +1175,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1177,12 +1189,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1224,7 +1236,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1232,14 +1244,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1262,12 +1274,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1278,7 +1290,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1293,12 +1305,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1398,53 +1410,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1452,14 +1464,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index 52cc3d661efaa8..c24ec8d3bc8eaf 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -2198,7 +2198,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4460,5 +4460,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/cc13x2x7_26x2x7/README.md b/examples/lighting-app/cc13x2x7_26x2x7/README.md index a9eacd879f5070..f6d77a423ac37a 100644 --- a/examples/lighting-app/cc13x2x7_26x2x7/README.md +++ b/examples/lighting-app/cc13x2x7_26x2x7/README.md @@ -58,9 +58,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -87,13 +87,13 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. ``` $ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -103,7 +103,7 @@ Ninja to build the executable. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" ``` ## Programming diff --git a/examples/lighting-app/cc13x4_26x4/README.md b/examples/lighting-app/cc13x4_26x4/README.md index beb1bfc42507be..2559c732dca70a 100644 --- a/examples/lighting-app/cc13x4_26x4/README.md +++ b/examples/lighting-app/cc13x4_26x4/README.md @@ -58,9 +58,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -87,13 +87,13 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. ``` $ cd ~/connectedhomeip/examples/lock-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -103,7 +103,7 @@ Ninja to build the executable. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" ``` ## Programming diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index c0b6344bcab4aa..f39d6580d31f65 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -265,33 +265,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -328,23 +328,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -436,7 +436,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -469,13 +469,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -483,7 +483,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -541,7 +541,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -565,7 +565,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -628,20 +628,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -702,13 +702,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -716,7 +716,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -780,7 +780,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -795,7 +795,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -810,12 +810,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -832,7 +832,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -840,7 +840,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -896,7 +896,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -912,7 +912,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -921,13 +921,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1036,13 +1044,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1050,7 +1058,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1073,7 +1081,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1083,7 +1091,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1097,7 +1105,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1105,14 +1113,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1178,8 +1186,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1207,24 +1215,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1234,7 +1242,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1375,19 +1383,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1396,7 +1404,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1406,7 +1414,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1449,7 +1457,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1462,7 +1470,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1483,14 +1491,14 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1540,21 +1548,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1567,7 +1579,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1581,12 +1593,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1628,7 +1640,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1636,14 +1648,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1666,12 +1678,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1682,7 +1694,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1697,12 +1709,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1802,53 +1814,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1856,14 +1868,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2070,18 +2082,18 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; @@ -2483,7 +2495,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index d59fee5200f253..c4f3572ec96857 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -3563,7 +3563,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4384,6 +4384,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -4701,7 +4702,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5975,5 +5976,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/nrfconnect/main/include/AppTask.h b/examples/lighting-app/nrfconnect/main/include/AppTask.h index 1a26e65eed50da..37be9a0334847c 100644 --- a/examples/lighting-app/nrfconnect/main/include/AppTask.h +++ b/examples/lighting-app/nrfconnect/main/include/AppTask.h @@ -42,13 +42,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance() { static AppTask sAppTask; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 1c0290d62ac20b..879cdadd19a22f 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -282,7 +282,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -315,13 +315,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -329,7 +329,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -386,7 +386,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -410,7 +410,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -466,20 +466,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -540,13 +540,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -554,7 +554,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -615,7 +615,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -623,7 +623,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -679,7 +679,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -695,7 +695,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -704,13 +704,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -812,7 +820,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -822,7 +830,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -836,7 +844,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -844,14 +852,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -911,8 +919,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -940,24 +948,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -967,7 +975,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1105,21 +1113,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1132,7 +1144,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; @@ -1141,12 +1153,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1188,7 +1200,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1196,14 +1208,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1226,12 +1238,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1242,7 +1254,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1257,12 +1269,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 12a02d45e7a282..4da6db3bf6d93b 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -2476,7 +2476,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3930,5 +3930,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 7bace4718ccaf9..7c055058372faf 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -285,7 +285,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -318,13 +318,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -332,7 +332,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -390,7 +390,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -414,7 +414,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -477,20 +477,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -551,13 +551,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -565,7 +565,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -626,7 +626,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -634,7 +634,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -690,7 +690,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -706,7 +706,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -715,13 +715,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -823,13 +831,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -837,7 +845,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -867,7 +875,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -877,7 +885,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -891,7 +899,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -899,14 +907,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -972,8 +980,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1001,24 +1009,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1028,7 +1036,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1166,21 +1174,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1193,7 +1205,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1207,12 +1219,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1254,7 +1266,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1262,14 +1274,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1292,12 +1304,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1308,7 +1320,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1323,12 +1335,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1428,53 +1440,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1482,14 +1494,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index a9e809e15b0498..ffd306791f7f40 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -3269,7 +3269,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -6207,5 +6207,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index e1951b6a9ba901..31c6acf21d6c38 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -286,33 +286,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -349,23 +349,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -457,7 +457,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -490,13 +490,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -504,7 +504,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -562,7 +562,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -586,7 +586,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -649,20 +649,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -723,13 +723,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -737,7 +737,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -801,7 +801,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -816,7 +816,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -831,12 +831,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -853,7 +853,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -889,7 +889,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -903,20 +903,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -1000,38 +1000,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1089,7 +1089,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1097,7 +1097,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1153,7 +1153,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1169,7 +1169,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1178,13 +1178,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1293,13 +1301,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1307,7 +1315,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1330,7 +1338,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1340,7 +1348,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1354,7 +1362,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1362,14 +1370,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1435,8 +1443,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1464,24 +1472,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1491,7 +1499,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1632,21 +1640,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1659,7 +1671,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1673,12 +1685,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1720,7 +1732,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1728,14 +1740,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1758,12 +1770,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1774,7 +1786,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1789,12 +1801,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1894,53 +1906,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1948,14 +1960,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2500,7 +2512,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 02f8e06de63acb..00e4fc3dc68664 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -2943,7 +2943,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3900,6 +3900,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -4257,7 +4258,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5915,5 +5916,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index ca9d823350b0b1..293faf071dbb16 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -265,33 +265,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -328,23 +328,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -436,7 +436,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -469,13 +469,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -483,7 +483,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -541,7 +541,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -565,7 +565,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -628,20 +628,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -702,13 +702,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -716,7 +716,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -780,7 +780,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -795,7 +795,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -810,12 +810,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -832,7 +832,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -868,7 +868,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -882,20 +882,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -979,38 +979,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1068,7 +1068,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1076,7 +1076,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1132,7 +1132,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1148,7 +1148,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1157,13 +1157,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1272,13 +1280,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1286,7 +1294,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1309,7 +1317,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1319,7 +1327,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1333,7 +1341,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1341,14 +1349,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1414,8 +1422,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1443,24 +1451,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1469,7 +1477,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1479,7 +1487,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1522,21 +1530,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1549,7 +1561,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1563,12 +1575,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1610,7 +1622,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1618,14 +1630,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1648,12 +1660,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1664,7 +1676,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1679,12 +1691,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1784,53 +1796,53 @@ server cluster UserLabel = 65 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -1838,14 +1850,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2340,7 +2352,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index e3a6e68d427d8b..76f4fde26b1b09 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -2143,7 +2143,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3100,6 +3100,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -3433,7 +3434,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5091,5 +5092,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/include/CHIPProjectConfig.h b/examples/lighting-app/silabs/include/CHIPProjectConfig.h index 00df921596102a..fc137c8d61d7d9 100644 --- a/examples/lighting-app/silabs/include/CHIPProjectConfig.h +++ b/examples/lighting-app/silabs/include/CHIPProjectConfig.h @@ -100,5 +100,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 666af084b2a8bf..278dfad530a1b0 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -24,7 +24,7 @@ a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/lighting-app/tizen/BUILD.gn b/examples/lighting-app/tizen/BUILD.gn index 4344f742f964c5..c0a38e7c113a91 100644 --- a/examples/lighting-app/tizen/BUILD.gn +++ b/examples/lighting-app/tizen/BUILD.gn @@ -15,15 +15,31 @@ import("//build_overrides/chip.gni") import("//build_overrides/tizen.gni") +import("${chip_root}/build/chip/linux/gdbus_library.gni") import("${chip_root}/build/chip/tools.gni") import("${chip_root}/src/app/common_flags.gni") import("${tizen_sdk_build_root}/tizen_sdk.gni") assert(chip_build_tools) +declare_args() { + # Enable D-Bus based UI functionality for example app + chip_examples_enable_ui = false +} + +gdbus_library("chip-lighting-app-manager") { + sources = [ "xml/DBusLightApp.xml" ] + interface_prefix = "org.tizen.matter.example.lighting" + c_namespace = "LightApp" + c_generate_object_manager = true + dbus_out_dir = "dbus" +} + executable("chip-lighting-app") { sources = [ "include/CHIPProjectAppConfig.h", + "include/LedManager.h", + "src/LedManager.cpp", "src/main.cpp", ] @@ -34,6 +50,14 @@ executable("chip-lighting-app") { "${chip_root}/src/lib", ] + if (chip_examples_enable_ui) { + sources += [ "src/DBusInterface.cpp" ] + deps += [ ":chip-lighting-app-manager" ] + defines = [ "ENABLE_DBUS_UI=1" ] + } else { + defines = [ "ENABLE_DBUS_UI=0" ] + } + include_dirs = [ "include" ] output_dir = root_out_dir diff --git a/examples/lighting-app/tizen/include/LedManager.h b/examples/lighting-app/tizen/include/LedManager.h new file mode 100644 index 00000000000000..690ffefbab01ef --- /dev/null +++ b/examples/lighting-app/tizen/include/LedManager.h @@ -0,0 +1,45 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include + +namespace example { +class LedManager +{ +public: + explicit LedManager(chip::EndpointId endpointId); + void SetOnOff(bool on); + CHIP_ERROR Init(); + +private: + void InitOnOff(); + + // Numbers of GPIO used to control LED in order: RED, GREEN, BLUE + static constexpr int number_of_pins = 3; + static constexpr int pins[number_of_pins] = { 20, 19, 18 }; + peripheral_gpio_h gpio[number_of_pins] = {}; + + const chip::EndpointId mEndpointId; +}; + +} // namespace example diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp new file mode 100644 index 00000000000000..86ae799dc1f5a2 --- /dev/null +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -0,0 +1,230 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DBusInterface.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dbus/DBusLightApp.h" + +using namespace chip; +using namespace chip::app; + +namespace example { + +// Dummy class to satisfy the CommandHandler::Callback interface. +class CommandHandlerCallback : public CommandHandler::Callback +{ +public: + using Status = Protocols::InteractionModel::Status; + void OnDone(CommandHandler & apCommandObj) {} + void DispatchCommand(CommandHandler & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) {} + Status CommandExists(const ConcreteCommandPath & aCommandPath) { return Status::Success; } +}; + +DBusInterface::DBusInterface(chip::EndpointId endpointId) : mEndpointId(endpointId) +{ + mManager = g_dbus_object_manager_server_new("/"); + mIfaceIdentify = light_app_identify_skeleton_new(); + mIfaceOnOff = light_app_on_off_skeleton_new(); + mIfaceLevelControl = light_app_level_control_skeleton_new(); + mIfaceColorControl = light_app_color_control_skeleton_new(); +} + +DBusInterface::~DBusInterface() +{ + g_object_unref(mIfaceIdentify); + g_object_unref(mIfaceOnOff); + g_object_unref(mIfaceLevelControl); + g_object_unref(mIfaceColorControl); + g_object_unref(mManager); +} + +CHIP_ERROR DBusInterface::Init() +{ + // During the initialization we are going to connect glib signals, so we need to be + // on the GLib Matter context. Otherwise, signals will be emitted on the glib default + // main context. + return chip::DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSync(InitOnGLibMatterContext, this); +} + +void DBusInterface::Identify(uint16_t time) +{ + light_app_identify_emit_identify(mIfaceIdentify, time); +} + +void DBusInterface::SetOnOff(bool on) +{ + InternalSetGuard guard(this); + if (light_app_on_off_get_on_off(mIfaceOnOff) != on) + light_app_on_off_set_on_off(mIfaceOnOff, on); +} + +void DBusInterface::SetCurrentLevel(uint8_t value) +{ + InternalSetGuard guard(this); + if (light_app_level_control_get_current_level(mIfaceLevelControl) != value) + light_app_level_control_set_current_level(mIfaceLevelControl, value); +} + +void DBusInterface::SetColorMode(chip::app::Clusters::ColorControl::ColorMode colorMode) +{ + InternalSetGuard guard(this); + if (light_app_color_control_get_color_mode(mIfaceColorControl) != colorMode) + light_app_color_control_set_color_mode(mIfaceColorControl, colorMode); +} + +void DBusInterface::SetColorTemperature(uint16_t value) +{ + InternalSetGuard guard(this); + if (light_app_color_control_get_color_temperature_mireds(mIfaceColorControl) != value) + light_app_color_control_set_color_temperature_mireds(mIfaceColorControl, value); +} + +CHIP_ERROR DBusInterface::InitOnGLibMatterContext(DBusInterface * self) +{ + g_autoptr(GDBusConnection) bus = nullptr; + g_autoptr(GError) error = nullptr; + + if ((bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &error)) == nullptr) + { + ChipLogError(NotSpecified, "Couldn't get D-Bus bus: %s", error->message); + return CHIP_ERROR_NOT_CONNECTED; + } + + LightAppObjectSkeleton * object = light_app_object_skeleton_new("/app"); + g_dbus_object_manager_server_export(self->mManager, G_DBUS_OBJECT_SKELETON(object)); + + light_app_object_skeleton_set_identify(object, self->mIfaceIdentify); + light_app_object_skeleton_set_on_off(object, self->mIfaceOnOff); + light_app_object_skeleton_set_level_control(object, self->mIfaceLevelControl); + light_app_object_skeleton_set_color_control(object, self->mIfaceColorControl); + + self->InitOnOff(); + self->InitColor(); + + g_dbus_object_manager_server_set_connection(self->mManager, bus); + g_object_unref(object); + + g_signal_connect(self->mIfaceOnOff, "notify::on-off", G_CALLBACK(OnOnOffChanged), self); + g_signal_connect(self->mIfaceLevelControl, "notify::current-level", G_CALLBACK(OnCurrentLevelChanged), self); + g_signal_connect(self->mIfaceColorControl, "notify::color-temperature-mireds", G_CALLBACK(OnColorTemperatureChanged), self); + + g_bus_own_name_on_connection(bus, "org.tizen.matter.example.lighting", G_BUS_NAME_OWNER_FLAGS_NONE, + reinterpret_cast(OnBusAcquired), + reinterpret_cast(OnBusLost), self, nullptr); + + return CHIP_NO_ERROR; +} + +void DBusInterface::OnBusAcquired(GDBusConnection *, const char *, DBusInterface * self) +{ + self->mNameAcquired = true; +} + +void DBusInterface::OnBusLost(GDBusConnection *, const char * name, DBusInterface * self) +{ + VerifyOrReturn(self->mNameAcquired, /* connection was lost after name was acquired, so it's not an error */); + ChipLogError(NotSpecified, "Couldn't acquire D-Bus name. Please check D-Bus configuration. Requested name: %s", name); +} + +gboolean DBusInterface::OnOnOffChanged(LightAppOnOff * onOff, GDBusMethodInvocation * invocation, DBusInterface * self) +{ + // Do not handle on-change event if it was triggered by internal set + VerifyOrReturnValue(!self->mInternalSet, G_DBUS_METHOD_INVOCATION_HANDLED); + + chip::DeviceLayer::StackLock lock; + OnOffServer::Instance().setOnOffValue(self->mEndpointId, + light_app_on_off_get_on_off(onOff) ? Clusters::OnOff::Commands::On::Id + : Clusters::OnOff::Commands::Off::Id, + false /* initiatedByLevelChange */); + return G_DBUS_METHOD_INVOCATION_HANDLED; +} + +gboolean DBusInterface::OnCurrentLevelChanged(LightAppLevelControl * levelControl, GDBusMethodInvocation * invocation, + DBusInterface * self) +{ + // Do not handle on-change event if it was triggered by internal set + VerifyOrReturnValue(!self->mInternalSet, G_DBUS_METHOD_INVOCATION_HANDLED); + + Clusters::LevelControl::Commands::MoveToLevel::DecodableType data; + data.level = light_app_level_control_get_current_level(levelControl); + data.optionsMask.Set(Clusters::LevelControl::LevelControlOptions::kExecuteIfOff); + data.optionsOverride.Set(Clusters::LevelControl::LevelControlOptions::kExecuteIfOff); + + chip::DeviceLayer::StackLock lock; + LevelControlServer::MoveToLevel(self->mEndpointId, data); + + return G_DBUS_METHOD_INVOCATION_HANDLED; +} + +gboolean DBusInterface::OnColorTemperatureChanged(LightAppColorControl * colorControl, GDBusMethodInvocation * invocation, + DBusInterface * self) +{ + // Do not handle on-change event if it was triggered by internal set + VerifyOrReturnValue(!self->mInternalSet, G_DBUS_METHOD_INVOCATION_HANDLED); + + CommandHandlerCallback callback; + CommandHandler handler(&callback); + + ConcreteCommandPath path{ self->mEndpointId, Clusters::ColorControl::Id, 0 }; + + Clusters::ColorControl::Commands::MoveToColorTemperature::DecodableType data; + data.colorTemperatureMireds = light_app_color_control_get_color_temperature_mireds(colorControl); + + chip::DeviceLayer::StackLock lock; + ColorControlServer::Instance().moveToColorTempCommand(&handler, path, data); + + return G_DBUS_METHOD_INVOCATION_HANDLED; +} + +void DBusInterface::InitOnOff() +{ + bool isOn = false; + auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn); + VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status)); + light_app_on_off_set_on_off(mIfaceOnOff, isOn); +} + +void DBusInterface::InitColor() +{ + { + uint8_t value = 0; + auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value); + VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", status)); + light_app_color_control_set_color_mode(mIfaceColorControl, value); + } + { + uint16_t value = 0; + auto status = Clusters::ColorControl::Attributes::ColorTemperatureMireds::Get(mEndpointId, &value); + VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, + ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", status)); + light_app_color_control_set_color_temperature_mireds(mIfaceColorControl, value); + } +} + +}; // namespace example diff --git a/examples/lighting-app/tizen/src/DBusInterface.h b/examples/lighting-app/tizen/src/DBusInterface.h new file mode 100644 index 00000000000000..c5d58775dde384 --- /dev/null +++ b/examples/lighting-app/tizen/src/DBusInterface.h @@ -0,0 +1,79 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include +#include + +#include "dbus/DBusLightApp.h" + +namespace example { + +class DBusInterface +{ +public: + explicit DBusInterface(chip::EndpointId endpointId); + ~DBusInterface(); + + CHIP_ERROR Init(); + + void Identify(uint16_t time); + void SetOnOff(bool on); + void SetCurrentLevel(uint8_t value); + void SetColorMode(chip::app::Clusters::ColorControl::ColorMode colorMode); + void SetColorTemperature(uint16_t value); + +private: + static CHIP_ERROR InitOnGLibMatterContext(DBusInterface * self); + static void OnBusAcquired(GDBusConnection *, const char *, DBusInterface * self); + static void OnBusLost(GDBusConnection *, const char * name, DBusInterface * self); + + static gboolean OnOnOffChanged(LightAppOnOff *, GDBusMethodInvocation *, DBusInterface *); + static gboolean OnCurrentLevelChanged(LightAppLevelControl *, GDBusMethodInvocation *, DBusInterface *); + static gboolean OnColorTemperatureChanged(LightAppColorControl *, GDBusMethodInvocation *, DBusInterface *); + + void InitOnOff(); + void InitColor(); + + class InternalSetGuard + { + public: + InternalSetGuard(DBusInterface * iface) : mIface(iface) { mIface->mInternalSet = true; } + ~InternalSetGuard() { mIface->mInternalSet = false; } + + private: + DBusInterface * mIface; + }; + + const chip::EndpointId mEndpointId; + + GDBusObjectManagerServer * mManager = nullptr; + bool mNameAcquired = false; + + LightAppIdentify * mIfaceIdentify = nullptr; + LightAppOnOff * mIfaceOnOff = nullptr; + LightAppLevelControl * mIfaceLevelControl = nullptr; + LightAppColorControl * mIfaceColorControl = nullptr; + bool mInternalSet = false; +}; + +} // namespace example diff --git a/examples/lighting-app/tizen/src/LedManager.cpp b/examples/lighting-app/tizen/src/LedManager.cpp new file mode 100644 index 00000000000000..0848675c7c0fef --- /dev/null +++ b/examples/lighting-app/tizen/src/LedManager.cpp @@ -0,0 +1,69 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include + +namespace example { + +using namespace chip; +using namespace chip::app; + +LedManager::LedManager(chip::EndpointId endpointId) : mEndpointId(endpointId){}; + +CHIP_ERROR LedManager::Init() +{ + InitOnOff(); + int ret = 0; + for (auto i = 0; i < number_of_pins; ++i) + { + ret = peripheral_gpio_open(pins[i], &gpio[i]); + VerifyOrReturnError(ret == PERIPHERAL_ERROR_NONE, CHIP_ERROR_INTERNAL, + ChipLogError(DeviceLayer, "Error openning gpio, pin number: %d", pins[i])); + ret = peripheral_gpio_set_direction(gpio[i], PERIPHERAL_GPIO_DIRECTION_OUT_INITIALLY_LOW); + VerifyOrReturnError(ret == PERIPHERAL_ERROR_NONE, CHIP_ERROR_INTERNAL, + ChipLogError(DeviceLayer, "Error setting direction of gpio, pin number: %d", pins[i])); + } + return CHIP_NO_ERROR; +} + +void LedManager::SetOnOff(const bool isOn) +{ + for (auto i = 0; i < number_of_pins; ++i) + { + int ret = 0; + ret = peripheral_gpio_write(gpio[i], isOn ? 1 : 0); + VerifyOrReturn(ret == PERIPHERAL_ERROR_NONE, + ChipLogError(DeviceLayer, "Error setting value to gpio, pin number: %d", pins[i])); + } +} + +void LedManager::InitOnOff() +{ + bool isOn = false; + auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn); + VerifyOrReturn(status == EMBER_ZCL_STATUS_SUCCESS, ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status)); + SetOnOff(isOn); +} + +} // namespace example diff --git a/examples/lighting-app/tizen/src/main.cpp b/examples/lighting-app/tizen/src/main.cpp index 8f0bafaec72e31..6a32e84b50cb6c 100644 --- a/examples/lighting-app/tizen/src/main.cpp +++ b/examples/lighting-app/tizen/src/main.cpp @@ -16,40 +16,127 @@ * limitations under the License. */ +#include #include #include #include #include #include +#include #include #include +#if ENABLE_DBUS_UI +#include "DBusInterface.h" +#endif + using namespace chip; using namespace chip::app; -using namespace chip::app::Clusters; -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI namespace { + +static constexpr chip::EndpointId chipEndpoint(1); + +#if ENABLE_DBUS_UI +example::DBusInterface sDBusInterface(chipEndpoint); +#endif + +static example::LedManager ledManager(chipEndpoint); + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI DeviceLayer::NetworkCommissioning::TizenWiFiDriver sTizenWiFiDriver; Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &sTizenWiFiDriver); -} // namespace #endif +} // namespace + void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, uint8_t * value) { - if (attributePath.mClusterId == OnOff::Id && attributePath.mAttributeId == OnOff::Attributes::OnOff::Id) + ChipLogDetail( + NotSpecified, "MatterPostAttributeChangeCallback: EndPoint=0x%x, Cluster=" ChipLogFormatMEI ", Attribute=" ChipLogFormatMEI, + attributePath.mEndpointId, ChipLogValueMEI(attributePath.mClusterId), ChipLogValueMEI(attributePath.mAttributeId)); + switch (attributePath.mClusterId) { - LightingMgr().InitiateAction(*value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION); + case Clusters::OnOff::Id: + switch (attributePath.mAttributeId) + { + case Clusters::OnOff::Attributes::OnOff::Id: + LightingMgr().InitiateAction(*value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION); + ledManager.SetOnOff(*value); +#if ENABLE_DBUS_UI + sDBusInterface.SetOnOff(*value); +#endif + break; + default: + ChipLogDetail(NotSpecified, "Not handled OnOff cluster attribute ID: " ChipLogFormatMEI, + ChipLogValueMEI(attributePath.mAttributeId)); + } + break; +#if ENABLE_DBUS_UI + case Clusters::Identify::Id: + switch (attributePath.mAttributeId) + { + case Clusters::Identify::Attributes::IdentifyTime::Id: + VerifyOrDie(size == sizeof(uint16_t)); + sDBusInterface.Identify(*reinterpret_cast(value)); + break; + default: + ChipLogDetail(NotSpecified, "Not handled Identify cluster attribute ID: " ChipLogFormatMEI, + ChipLogValueMEI(attributePath.mAttributeId)); + } + break; + case Clusters::LevelControl::Id: + switch (attributePath.mAttributeId) + { + case Clusters::LevelControl::Attributes::CurrentLevel::Id: + sDBusInterface.SetCurrentLevel(*value); + break; + default: + ChipLogDetail(NotSpecified, "Not handled LevelControl cluster attribute ID: " ChipLogFormatMEI, + ChipLogValueMEI(attributePath.mAttributeId)); + } + break; + case Clusters::ColorControl::Id: + switch (attributePath.mAttributeId) + { + case Clusters::ColorControl::Attributes::ColorMode::Id: + sDBusInterface.SetColorMode(static_cast(*value)); + break; + case Clusters::ColorControl::Attributes::ColorTemperatureMireds::Id: + VerifyOrDie(size == sizeof(uint16_t)); + sDBusInterface.SetColorTemperature(*reinterpret_cast(value)); + break; + default: + ChipLogDetail(NotSpecified, "Not handled ColorControl cluster attribute ID: " ChipLogFormatMEI, + ChipLogValueMEI(attributePath.mAttributeId)); + } + break; +#endif // ENABLE_DBUS_UI + default: + ChipLogDetail(NotSpecified, "Not handled cluster ID: " ChipLogFormatMEI, ChipLogValueMEI(attributePath.mClusterId)); } } +void emberAfColorControlClusterInitCallback(EndpointId endpoint) +{ + // Set the color mode to color temperature. + Clusters::ColorControl::Attributes::ColorMode::Set(endpoint, + Clusters::ColorControl::ColorMode::EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE); + // Preserve the state of the color temperature attribute across reboots. + Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::SetNull(endpoint); +} + void ApplicationInit() { +#if ENABLE_DBUS_UI + sDBusInterface.Init(); +#endif #if CHIP_DEVICE_CONFIG_ENABLE_WIFI sWiFiNetworkCommissioningInstance.Init(); #endif + ledManager.Init(); } void ApplicationShutdown() {} @@ -58,7 +145,6 @@ int main(int argc, char * argv[]) { TizenServiceAppMain app; VerifyOrDie(app.Init(argc, argv) == 0); - VerifyOrDie(LightingMgr().Init() == CHIP_NO_ERROR); return app.RunMainLoop(); diff --git a/examples/lighting-app/tizen/tizen-manifest.xml b/examples/lighting-app/tizen/tizen-manifest.xml index 4cb6047b528173..d9e5771cb4faab 100644 --- a/examples/lighting-app/tizen/tizen-manifest.xml +++ b/examples/lighting-app/tizen/tizen-manifest.xml @@ -10,6 +10,7 @@ http://tizen.org/privilege/network.get http://tizen.org/privilege/network.set http://tizen.org/privilege/network.profile + http://tizen.org/privilege/peripheralio true true diff --git a/examples/lighting-app/tizen/xml/DBusLightApp.xml b/examples/lighting-app/tizen/xml/DBusLightApp.xml new file mode 100644 index 00000000000000..71ae99262b985b --- /dev/null +++ b/examples/lighting-app/tizen/xml/DBusLightApp.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/examples/lock-app/cc13x2x7_26x2x7/README.md b/examples/lock-app/cc13x2x7_26x2x7/README.md index 01e2f1a189d839..7b056d2cab29b5 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/README.md +++ b/examples/lock-app/cc13x2x7_26x2x7/README.md @@ -59,9 +59,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -88,7 +88,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -96,7 +96,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/lock-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -106,7 +106,7 @@ Ninja to build the executable. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/lock-app/cc13x4_26x4/README.md b/examples/lock-app/cc13x4_26x4/README.md index 45c3a1c67309cd..a230fbb8bd5fdd 100644 --- a/examples/lock-app/cc13x4_26x4/README.md +++ b/examples/lock-app/cc13x4_26x4/README.md @@ -59,9 +59,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -88,7 +88,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -96,7 +96,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/lock-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -106,7 +106,7 @@ Ninja to build the executable. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/lock-app/linux/src/LockAppCommandDelegate.cpp b/examples/lock-app/linux/src/LockAppCommandDelegate.cpp index 92602a70c022c2..356888b992fde2 100644 --- a/examples/lock-app/linux/src/LockAppCommandDelegate.cpp +++ b/examples/lock-app/linux/src/LockAppCommandDelegate.cpp @@ -17,6 +17,7 @@ */ #include "LockAppCommandDelegate.h" +#include #include #include @@ -36,6 +37,10 @@ class LockAppCommandHandler {} private: + // aCommand should be "lock" or "unlock". + static CHIP_ERROR ExtractPINFromParams(const char * aCommand, const Json::Value & aParams, Optional & aPIN, + chip::Platform::ScopedMemoryBuffer & aPINBuffer); + std::string mCommandName; Json::Value mCommandParameters; }; @@ -84,6 +89,7 @@ void LockAppCommandHandler::HandleCommand(intptr_t context) const auto & params = self->mCommandParameters; // Determine the endpoint ID from the parameters JSON. If it is missing, use the default endpoint defined in the // door-lock-server.h + CHIP_ERROR err = CHIP_NO_ERROR; chip::EndpointId endpointId = DOOR_LOCK_SERVER_ENDPOINT; if (params.isMember("EndpointId")) { @@ -131,15 +137,103 @@ void LockAppCommandHandler::HandleCommand(intptr_t context) alarmCode)); LockManager::Instance().SendLockAlarm(endpointId, static_cast(alarmCode)); } + else if (self->mCommandName == "Lock") + { + + VerifyOrExit(params["OperationSource"].isUInt(), + ChipLogError(NotSpecified, "Lock App: Unable to execute command to lock: invalid type for OperationSource")); + + auto operationSource = params["OperationSource"].asUInt(); + + Optional pin; + chip::Platform::ScopedMemoryBuffer pinBuffer; + SuccessOrExit(err = ExtractPINFromParams("lock", params, pin, pinBuffer)); + + OperationErrorEnum error = OperationErrorEnum::kUnspecified; + LockManager::Instance().Lock(endpointId, NullNullable, NullNullable, pin, error, OperationSourceEnum(operationSource)); + VerifyOrExit(error == OperationErrorEnum::kUnspecified, + ChipLogError(NotSpecified, "Lock App: Lock error received: %u", to_underlying(error))); + } + else if (self->mCommandName == "Unlock") + { + VerifyOrExit(params["OperationSource"].isUInt(), + ChipLogError(NotSpecified, "Lock App: Unable to execute command to unlock: invalid type for OperationSource")); + + auto operationSource = params["OperationSource"].asUInt(); + + Optional pin; + chip::Platform::ScopedMemoryBuffer pinBuffer; + SuccessOrExit(err = ExtractPINFromParams("unlock", params, pin, pinBuffer)); + + OperationErrorEnum error = OperationErrorEnum::kUnspecified; + LockManager::Instance().Unlock(endpointId, NullNullable, NullNullable, pin, error, OperationSourceEnum(operationSource)); + VerifyOrExit(error == OperationErrorEnum::kUnspecified, + ChipLogError(NotSpecified, "Lock App: Unlock error received: %u", to_underlying(error))); + } else { ChipLogError(NotSpecified, "Lock App: Unable to execute command \"%s\": command not supported", self->mCommandName.c_str()); } exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Lock App: Failed executing command \"%s\": %" CHIP_ERROR_FORMAT, self->mCommandName.c_str(), + err.Format()); + } chip::Platform::Delete(self); } +CHIP_ERROR LockAppCommandHandler::ExtractPINFromParams(const char * aCommand, const Json::Value & aParams, + Optional & aPIN, + chip::Platform::ScopedMemoryBuffer & aPINBuffer) +{ + if (aParams.isMember("PINAsHex")) + { + // Hex-encoded PIN bytes. So a PIN consisting of the numbers 123 gets encoded as the string "313233" + VerifyOrReturnError( + aParams["PINAsHex"].isString(), CHIP_ERROR_INVALID_ARGUMENT, + ChipLogError(NotSpecified, "Lock App: Unable to execute command to %s: invalid type for PIN", aCommand)); + + auto pinAsHex = aParams["PINAsHex"].asString(); + size_t size = pinAsHex.length(); + VerifyOrReturnError(size % 2 == 0, CHIP_ERROR_INVALID_STRING_LENGTH); + + size_t bufferSize = size / 2; + + VerifyOrReturnError(aPINBuffer.Calloc(bufferSize), CHIP_ERROR_NO_MEMORY); + size_t octetCount = chip::Encoding::HexToBytes(pinAsHex.c_str(), size, aPINBuffer.Get(), bufferSize); + VerifyOrReturnError( + octetCount != 0 || size == 0, CHIP_ERROR_INVALID_ARGUMENT, + ChipLogError(NotSpecified, "Lock app: Unable to execute command to %s: invalid hex value for PIN", aCommand)); + + aPIN.Emplace(aPINBuffer.Get(), octetCount); + ChipLogProgress(NotSpecified, "Lock App: Received command to %s with hex PIN: %s", aCommand, pinAsHex.c_str()); + } + else if (aParams.isMember("PINAsString")) + { + // ASCII-encoded PIN bytes. So a PIN consisting of the numbers 123 gets encoded as the string "123" + VerifyOrReturnError( + aParams["PINAsString"].isString(), CHIP_ERROR_INVALID_ARGUMENT, + ChipLogError(NotSpecified, "Lock App: Unable to execute command to %s: invalid type for PIN", aCommand)); + + auto pinAsString = aParams["PINAsString"].asString(); + size_t bufferSize = pinAsString.length(); + + VerifyOrReturnError(aPINBuffer.Calloc(bufferSize), CHIP_ERROR_NO_MEMORY); + memcpy(aPINBuffer.Get(), pinAsString.c_str(), bufferSize); + aPIN.Emplace(aPINBuffer.Get(), bufferSize); + + ChipLogProgress(NotSpecified, "Lock App: Received command to %s with string PIN: %s", aCommand, pinAsString.c_str()); + } + else + { + aPIN.ClearValue(); + } + + return CHIP_NO_ERROR; +} + void LockAppCommandDelegate::OnEventCommandReceived(const char * json) { auto handler = LockAppCommandHandler::FromJSON(json); diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index a3a9f869ea9a32..b3f6f1c74593a3 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,33 +49,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -98,7 +98,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -131,13 +131,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -145,7 +145,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -203,7 +203,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -227,7 +227,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -290,20 +290,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -364,13 +364,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -378,7 +378,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -442,7 +442,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -457,7 +457,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -472,12 +472,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -497,13 +497,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -517,7 +517,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -553,7 +553,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -567,20 +567,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -664,38 +664,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -751,7 +751,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -759,7 +759,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -815,7 +815,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -831,7 +831,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -840,13 +840,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -955,13 +963,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -969,7 +977,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -992,7 +1000,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1002,7 +1010,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1016,7 +1024,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1024,14 +1032,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1097,8 +1105,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1126,24 +1134,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1153,7 +1161,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1294,19 +1302,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1315,7 +1323,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1325,7 +1333,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1368,7 +1376,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1381,7 +1389,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1402,26 +1410,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1434,7 +1446,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1448,12 +1460,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1495,7 +1507,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1503,14 +1515,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1533,12 +1545,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1549,7 +1561,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1564,12 +1576,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1669,8 +1681,30 @@ server cluster UserLabel = 65 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; } fabric_scoped struct MonitoringRegistrationStruct { @@ -1679,8 +1713,8 @@ server cluster IcdManagement = 70 { fabric_idx fabricIndex = 254; } - readonly attribute int32u idleModeInterval = 0; - readonly attribute int32u activeModeInterval = 1; + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; readonly attribute int16u activeModeThreshold = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1692,7 +1726,7 @@ server cluster IcdManagement = 70 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -1703,13 +1737,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -1718,20 +1752,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -1746,7 +1780,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -1756,7 +1790,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -1774,7 +1808,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -1784,21 +1818,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1807,7 +1841,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -1816,7 +1850,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -1830,7 +1864,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -1838,7 +1872,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -1846,7 +1880,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -1854,7 +1888,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -1867,13 +1901,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1886,7 +1920,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1896,19 +1930,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -1917,7 +1951,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1928,7 +1962,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1936,14 +1970,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -1957,7 +1991,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1967,13 +2001,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1983,7 +2017,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1993,7 +2027,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -2001,7 +2035,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2011,7 +2045,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -2684,11 +2718,11 @@ endpoint 0 { } server cluster IcdManagement { - callback attribute idleModeInterval default = 500; - callback attribute activeModeInterval default = 300; + callback attribute idleModeDuration default = 500; + callback attribute activeModeDuration default = 300; callback attribute activeModeThreshold default = 300; ram attribute featureMap default = 0x0000; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } } endpoint 1 { diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 88205e634b3561..e079f41ed81adf 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -4285,7 +4285,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5039,7 +5039,7 @@ "enabled": 1, "attributes": [ { - "name": "IdleModeInterval", + "name": "IdleModeDuration", "code": 0, "mfgCode": null, "side": "server", @@ -5055,7 +5055,7 @@ "reportableChange": 0 }, { - "name": "ActiveModeInterval", + "name": "ActiveModeDuration", "code": 1, "mfgCode": null, "side": "server", @@ -5112,7 +5112,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6644,5 +6644,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lock-app/nrfconnect/main/include/AppTask.h b/examples/lock-app/nrfconnect/main/include/AppTask.h index c65d3f1694c70f..50b4dd4b5b767d 100644 --- a/examples/lock-app/nrfconnect/main/include/AppTask.h +++ b/examples/lock-app/nrfconnect/main/include/AppTask.h @@ -37,13 +37,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance() { static AppTask sAppTask; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 6a52e42e404594..9b030c237fb074 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -153,7 +153,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -177,7 +177,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -233,7 +233,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -241,7 +241,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -297,7 +297,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -313,7 +313,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -322,13 +322,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -430,7 +438,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -440,7 +448,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -454,7 +462,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -462,14 +470,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -529,8 +537,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -558,24 +566,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -585,7 +593,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -723,21 +731,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -750,7 +762,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; @@ -759,12 +771,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -806,7 +818,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -814,14 +826,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -844,12 +856,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -860,7 +872,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -875,12 +887,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -947,7 +959,7 @@ server cluster GroupKeyManagement = 63 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -958,13 +970,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -973,20 +985,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -1001,7 +1013,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -1011,7 +1023,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -1029,7 +1041,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -1039,21 +1051,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1062,7 +1074,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -1071,7 +1083,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -1085,7 +1097,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -1093,7 +1105,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -1101,7 +1113,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -1109,7 +1121,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -1122,13 +1134,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1141,7 +1153,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1151,19 +1163,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -1172,7 +1184,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1183,7 +1195,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1191,14 +1203,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -1212,7 +1224,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1222,13 +1234,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1238,7 +1250,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1248,7 +1260,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -1256,7 +1268,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1266,7 +1278,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 39ab65db171c8f..103c17087eccfd 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -2269,7 +2269,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3393,5 +3393,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index f2081def2b0850..5b67875cce9279 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -459,7 +459,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -467,7 +467,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -523,7 +523,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -539,7 +539,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -548,13 +548,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -656,13 +664,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -670,7 +678,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -700,7 +708,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -710,7 +718,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -724,7 +732,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -732,14 +740,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -805,8 +813,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -834,24 +842,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -861,7 +869,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -999,21 +1007,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1026,7 +1038,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1040,12 +1052,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1087,7 +1099,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1095,14 +1107,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1125,12 +1137,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1141,7 +1153,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1156,12 +1168,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1261,7 +1273,7 @@ server cluster UserLabel = 65 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -1272,13 +1284,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -1287,20 +1299,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -1315,7 +1327,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -1325,7 +1337,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -1343,7 +1355,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -1353,21 +1365,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1376,7 +1388,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -1385,7 +1397,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -1399,7 +1411,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -1407,7 +1419,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -1415,7 +1427,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -1423,7 +1435,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -1436,13 +1448,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1455,7 +1467,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1465,19 +1477,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -1486,7 +1498,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1497,7 +1509,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1505,14 +1517,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -1526,7 +1538,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1536,13 +1548,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -1552,7 +1564,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -1562,7 +1574,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -1570,7 +1582,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1580,7 +1592,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index ff7f8aa51c565e..e66ddc5a32eac5 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -3269,7 +3269,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5268,5 +5268,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lock-app/silabs/include/CHIPProjectConfig.h b/examples/lock-app/silabs/include/CHIPProjectConfig.h index ae0cbaf1b3ac68..87d7485558c659 100644 --- a/examples/lock-app/silabs/include/CHIPProjectConfig.h +++ b/examples/lock-app/silabs/include/CHIPProjectConfig.h @@ -100,5 +100,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 2d8e0349d571a1..4d20388ce4277a 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -24,7 +24,7 @@ a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 4f9cbf9bfbade2..207575f2e08c50 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -6,13 +6,13 @@ and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -20,7 +20,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -76,7 +76,7 @@ server cluster AccessControl = 31 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -84,7 +84,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -138,7 +138,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -154,7 +154,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -163,13 +163,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -270,13 +278,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -284,7 +292,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -314,12 +322,12 @@ server cluster DiagnosticLogs = 50 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -359,7 +367,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -367,14 +375,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -392,12 +400,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -408,7 +416,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -421,7 +429,7 @@ server cluster OperationalCredentials = 62 { } endpoint 0 { - device type ma_all_clusters_app = 0, version 1; + device type ma_all_clusters_app = 4293984259, version 1; server cluster AccessControl { diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index 80c02f74e6941b..4be1a514aea258 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -37,14 +37,14 @@ "id": 1, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 0, + "code": 4293984259, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" }, "deviceTypes": [ { - "code": 0, + "code": 4293984259, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" @@ -54,10 +54,10 @@ 1 ], "deviceIdentifiers": [ - 0 + 4293984259 ], "deviceTypeName": "MA-all-clusters-app", - "deviceTypeCode": 0, + "deviceTypeCode": 4293984259, "deviceTypeProfileId": 259, "clusters": [ { @@ -733,9 +733,10 @@ { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 0, - "profileId": 598, + "profileId": 259, "endpointId": 0, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 8c5f5941ac087f..e5187ffa74eefb 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -3,7 +3,7 @@ /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -36,13 +36,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ client cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -50,7 +50,7 @@ client cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -109,13 +109,13 @@ client cluster AccessControl = 31 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -123,7 +123,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -181,7 +181,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -205,7 +205,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -268,20 +268,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ server cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -342,7 +342,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -357,7 +357,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -372,12 +372,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -394,7 +394,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -402,7 +402,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -458,7 +458,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -474,7 +474,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -483,13 +483,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -598,7 +606,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -608,7 +616,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -622,7 +630,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -630,14 +638,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -703,21 +711,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -730,7 +742,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -744,12 +756,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -791,7 +803,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -799,14 +811,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -829,12 +841,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -845,7 +857,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -860,12 +872,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index da75a6de71daaf..3776092d0b62dd 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1703,7 +1703,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2267,5 +2267,6 @@ "endpointId": 0, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/ota-requestor-app/ameba/README.md b/examples/ota-requestor-app/ameba/README.md index c30a1fb435df59..2ce04fc328ceed 100644 --- a/examples/ota-requestor-app/ameba/README.md +++ b/examples/ota-requestor-app/ameba/README.md @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities. - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 - Setup build environment: diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 2ce8438f9856b8..583331cd2a86ee 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,33 +118,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,7 +181,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -214,13 +214,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -228,7 +228,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -286,7 +286,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -310,7 +310,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -373,20 +373,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -447,13 +447,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -461,7 +461,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -525,7 +525,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -540,7 +540,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -555,12 +555,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -577,7 +577,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -585,7 +585,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -641,7 +641,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -657,7 +657,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -666,13 +666,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -781,7 +789,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -791,7 +799,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -805,7 +813,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -813,14 +821,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -886,21 +894,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -913,7 +925,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -927,12 +939,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -974,7 +986,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -982,14 +994,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1012,12 +1024,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1028,7 +1040,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1043,12 +1055,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1411,7 +1423,7 @@ endpoint 1 { } } endpoint 65534 { - device type ma_secondary_network_commissioning = 61442, version 1; + device type ma_secondary_network_commissioning = 4293984258, version 1; server cluster Descriptor { @@ -1419,6 +1431,10 @@ endpoint 65534 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; callback attribute clusterRevision default = 1; } @@ -1432,6 +1448,10 @@ endpoint 65534 { callback attribute lastNetworkingStatus; callback attribute lastNetworkID; callback attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap default = 0; callback attribute clusterRevision default = 1; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index 9b6953e8f44e42..e36f3b95848231 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1752,7 +1752,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2898,14 +2898,14 @@ "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" }, "deviceTypes": [ { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" @@ -2915,10 +2915,10 @@ 1 ], "deviceIdentifiers": [ - 61442 + 4293984258 ], "deviceTypeName": "MA-secondary-network-commissioning", - "deviceTypeCode": 61442, + "deviceTypeCode": 4293984258, "deviceTypeProfileId": 259, "clusters": [ { @@ -2993,6 +2993,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -3237,6 +3301,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -3296,5 +3424,6 @@ "endpointId": 65534, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index 867f498f9df917..bf58651ce0253a 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -17,7 +17,7 @@ 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/persistent-storage/cc13x2x7_26x2x7/README.md b/examples/persistent-storage/cc13x2x7_26x2x7/README.md index fc06023b7edb83..87e4add6701eca 100644 --- a/examples/persistent-storage/cc13x2x7_26x2x7/README.md +++ b/examples/persistent-storage/cc13x2x7_26x2x7/README.md @@ -140,13 +140,13 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.11.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. ``` $ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7 - $ export TI_SYSCONFIG_ROOT=$HOME/ti/sysconfig_1.10.0 + $ export TI_SYSCONFIG_ROOT=$HOME/ti/sysconfig_1.16.2 $ gn gen out/debug --args="ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\"" $ ninja -C out/debug diff --git a/examples/pigweed-app/ameba/README.md b/examples/pigweed-app/ameba/README.md index 361ab87509d2bb..d294295bc5f0e5 100644 --- a/examples/pigweed-app/ameba/README.md +++ b/examples/pigweed-app/ameba/README.md @@ -31,11 +31,11 @@ following features are available: - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:21 + $ docker pull ghcr.io/project-chip/chip-build-ameba:22 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:21 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 - Setup build environment: diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 990047f1259d9f..1040513cc7c557 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ client cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -51,7 +51,7 @@ client cluster Identify = 3 { /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -60,11 +60,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -97,11 +97,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -115,7 +115,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -132,7 +132,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -143,7 +143,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -166,14 +166,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -192,6 +192,8 @@ provisional server cluster Scenes = 5 { readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; + readonly attribute int16u sceneTableSize = 6; + readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -286,33 +288,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -355,33 +357,33 @@ client cluster OnOff = 6 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -418,23 +420,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ client cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -541,23 +543,23 @@ client cluster LevelControl = 8 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -649,7 +651,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -682,13 +684,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -696,7 +698,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -752,19 +754,19 @@ server cluster AccessControl = 31 { /** This cluster provides a standardized way for a Node (typically a Bridge, but could be any Node) to expose action information. */ server cluster Actions = 37 { - enum ActionErrorEnum : ENUM8 { + enum ActionErrorEnum : enum8 { kUnknown = 0; kInterrupted = 1; } - enum ActionStateEnum : ENUM8 { + enum ActionStateEnum : enum8 { kInactive = 0; kActive = 1; kPaused = 2; kDisabled = 3; } - enum ActionTypeEnum : ENUM8 { + enum ActionTypeEnum : enum8 { kOther = 0; kScene = 1; kSequence = 2; @@ -774,13 +776,13 @@ server cluster Actions = 37 { kAlarm = 6; } - enum EndpointListTypeEnum : ENUM8 { + enum EndpointListTypeEnum : enum8 { kOther = 0; kRoom = 1; kZone = 2; } - bitmap CommandBits : BITMAP16 { + bitmap CommandBits : bitmap16 { kInstantAction = 0x1; kInstantActionWithTransition = 0x2; kStartAction = 0x4; @@ -839,7 +841,7 @@ server cluster Actions = 37 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -863,7 +865,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -930,7 +932,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ client cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -945,7 +947,7 @@ client cluster LocalizationConfiguration = 43 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -960,7 +962,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -975,12 +977,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -1000,13 +1002,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ client cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -1024,13 +1026,13 @@ client cluster UnitLocalization = 45 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -1045,7 +1047,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -1081,7 +1083,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -1095,20 +1097,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -1192,38 +1194,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1302,7 +1304,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ client cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1310,7 +1312,7 @@ client cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1369,7 +1371,7 @@ client cluster GeneralCommissioning = 48 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1377,7 +1379,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1433,7 +1435,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1449,7 +1451,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1458,13 +1460,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1573,7 +1583,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1583,7 +1593,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1597,7 +1607,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1605,14 +1615,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1678,8 +1688,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1707,24 +1717,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ client cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1734,7 +1744,7 @@ client cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1876,19 +1886,19 @@ client cluster ThreadNetworkDiagnostics = 53 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1898,7 +1908,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -2039,19 +2049,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -2060,7 +2070,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -2070,7 +2080,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2113,7 +2123,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -2126,7 +2136,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2147,7 +2157,7 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This Cluster serves two purposes towards a Node communicating with a Bridge: indicate that the functionality on @@ -2155,7 +2165,7 @@ server cluster EthernetNetworkDiagnostics = 55 { collection of attributes that the Node MAY collect to aid in conveying information regarding the Bridged Device to a user, such as the vendor name, the model name, or user-assigned name. */ server cluster BridgedDeviceBasicInformation = 57 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -2179,7 +2189,7 @@ server cluster BridgedDeviceBasicInformation = 57 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -2235,7 +2245,7 @@ server cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ client cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2288,7 +2298,7 @@ client cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2339,21 +2349,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2366,7 +2380,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -2380,12 +2394,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ client cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -2427,12 +2441,12 @@ client cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } request struct CertificateChainRequestRequest { @@ -2440,11 +2454,11 @@ client cluster OperationalCredentials = 62 { } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } @@ -2454,9 +2468,9 @@ client cluster OperationalCredentials = 62 { } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -2469,7 +2483,7 @@ client cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } request struct UpdateFabricLabelRequest { @@ -2504,12 +2518,12 @@ client cluster OperationalCredentials = 62 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -2551,7 +2565,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -2559,14 +2573,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -2589,12 +2603,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -2605,7 +2619,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -2620,12 +2634,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -2757,7 +2771,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2795,7 +2809,7 @@ client cluster ModeSelect = 80 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2831,7 +2845,7 @@ server cluster ModeSelect = 80 { /** An interface to a generic way to secure a door */ client cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -2842,13 +2856,13 @@ client cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -2857,20 +2871,20 @@ client cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -2885,7 +2899,7 @@ client cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -2895,7 +2909,7 @@ client cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -2913,7 +2927,7 @@ client cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -2923,21 +2937,21 @@ client cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2946,7 +2960,7 @@ client cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -2955,7 +2969,7 @@ client cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -2969,7 +2983,7 @@ client cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -2977,7 +2991,7 @@ client cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -2985,7 +2999,7 @@ client cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -2993,7 +3007,7 @@ client cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -3006,13 +3020,13 @@ client cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -3025,7 +3039,7 @@ client cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3035,19 +3049,19 @@ client cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -3056,7 +3070,7 @@ client cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3067,7 +3081,7 @@ client cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3075,14 +3089,14 @@ client cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -3096,7 +3110,7 @@ client cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3106,13 +3120,13 @@ client cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3122,7 +3136,7 @@ client cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3132,7 +3146,7 @@ client cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -3140,7 +3154,7 @@ client cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3150,7 +3164,7 @@ client cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -3451,7 +3465,7 @@ client cluster DoorLock = 257 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -3462,13 +3476,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -3477,20 +3491,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -3505,7 +3519,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -3515,7 +3529,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -3533,7 +3547,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -3543,21 +3557,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -3566,7 +3580,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -3575,7 +3589,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -3589,7 +3603,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -3597,7 +3611,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -3605,7 +3619,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -3613,7 +3627,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -3626,13 +3640,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -3645,7 +3659,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3655,19 +3669,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -3676,7 +3690,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3687,7 +3701,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3695,14 +3709,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -3716,7 +3730,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3726,13 +3740,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3742,7 +3756,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3752,7 +3766,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -3760,7 +3774,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3770,7 +3784,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -3951,7 +3965,7 @@ server cluster DoorLock = 257 { /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -3979,7 +3993,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -3993,7 +4007,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -4003,7 +4017,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -4011,20 +4025,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; @@ -4091,7 +4105,7 @@ server cluster WindowCovering = 258 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -4100,14 +4114,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -4117,9 +4131,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -4213,13 +4227,13 @@ server cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ client cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -4228,13 +4242,13 @@ client cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -4246,7 +4260,7 @@ client cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -4257,7 +4271,7 @@ client cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4267,7 +4281,7 @@ client cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -4370,13 +4384,13 @@ client cluster Thermostat = 513 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -4385,13 +4399,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -4403,7 +4417,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -4414,7 +4428,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4424,7 +4438,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -4519,53 +4533,53 @@ server cluster ThermostatUserInterfaceConfiguration = 516 { /** Attributes and commands for controlling the color properties of a color-capable light. */ client cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -4573,14 +4587,14 @@ client cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -4837,53 +4851,53 @@ client cluster ColorControl = 768 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -4891,14 +4905,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -5136,7 +5150,7 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */ server cluster IlluminanceMeasurement = 1024 { - enum LightSensorTypeEnum : ENUM8 { + enum LightSensorTypeEnum : enum8 { kPhotodiode = 0; kCMOS = 1; } @@ -5156,10 +5170,10 @@ server cluster IlluminanceMeasurement = 1024 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ client cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute optional int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute optional temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5170,10 +5184,10 @@ client cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5184,7 +5198,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -5249,18 +5263,18 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; @@ -5288,17 +5302,17 @@ server cluster OccupancySensing = 1030 { /** This cluster provides an interface for controlling the current Channel on a device. */ client cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -5356,17 +5370,17 @@ client cluster Channel = 1284 { /** This cluster provides an interface for controlling the current Channel on a device. */ server cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -5416,7 +5430,7 @@ server cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ client cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -5452,7 +5466,7 @@ client cluster TargetNavigator = 1285 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ server cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -5475,7 +5489,7 @@ server cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ client cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -5484,14 +5498,14 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -5558,7 +5572,7 @@ client cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ server cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -5567,14 +5581,14 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -5630,7 +5644,7 @@ server cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ client cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -5645,15 +5659,15 @@ client cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -5681,12 +5695,12 @@ client cluster MediaInput = 1287 { /** Upon receipt, this SHALL hide the input list from the screen. */ command HideInputStatus(): DefaultSuccess = 2; /** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */ - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ server cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -5701,15 +5715,15 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -5733,7 +5747,7 @@ server cluster MediaInput = 1287 { command SelectInput(SelectInputRequest): DefaultSuccess = 0; command ShowInputStatus(): DefaultSuccess = 1; command HideInputStatus(): DefaultSuccess = 2; - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for managing low power mode on a device. */ @@ -5751,7 +5765,7 @@ client cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ client cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -5840,13 +5854,13 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -5873,7 +5887,7 @@ client cluster KeypadInput = 1289 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ server cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -5962,13 +5976,13 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -5984,18 +5998,18 @@ server cluster KeypadInput = 1289 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -6012,12 +6026,12 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -6092,18 +6106,18 @@ client cluster ContentLauncher = 1290 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -6120,12 +6134,12 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -6198,7 +6212,7 @@ server cluster ContentLauncher = 1290 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ client cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -6207,18 +6221,18 @@ client cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; - readonly attribute optional int8u currentOutput = 1; + readonly attribute int8u currentOutput = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6238,12 +6252,12 @@ client cluster AudioOutput = 1291 { /** Upon receipt, this SHALL change the output on the media device to the output at a specific index in the Output List. */ command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; /** Upon receipt, this SHALL rename the output at a specific index in the Output List. Updates to the output name SHALL appear in the TV settings menus. */ - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ server cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -6252,14 +6266,14 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; @@ -6281,18 +6295,18 @@ server cluster AudioOutput = 1291 { } command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -6343,13 +6357,13 @@ client cluster ApplicationLauncher = 1292 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -6375,7 +6389,7 @@ server cluster ApplicationLauncher = 1292 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ client cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -6389,12 +6403,12 @@ client cluster ApplicationBasic = 1293 { readonly attribute optional char_string<32> vendorName = 0; readonly attribute optional vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute optional int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6405,7 +6419,7 @@ client cluster ApplicationBasic = 1293 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ server cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -6419,12 +6433,12 @@ server cluster ApplicationBasic = 1293 { readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7365,10 +7379,12 @@ endpoint 1 { ram attribute currentGroup default = 0x0000; ram attribute sceneValid default = 0x00; ram attribute nameSupport; + ram attribute sceneTableSize default = 16; + callback attribute remainingCapacity default = 8; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index f4bdb87e424a67..c1166d993338fd 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -5090,7 +5090,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -11120,7 +11120,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11785,6 +11785,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -11972,6 +11973,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "16", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "8", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -12030,7 +12063,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15156,5 +15189,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index f11e7bb353e52c..a2662b804165b9 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ client cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -51,7 +51,7 @@ client cluster Identify = 3 { /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -60,11 +60,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -97,11 +97,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -115,7 +115,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -132,7 +132,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -143,7 +143,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -166,14 +166,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -192,6 +192,8 @@ provisional server cluster Scenes = 5 { readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; readonly attribute bitmap8 nameSupport = 4; + readonly attribute int16u sceneTableSize = 6; + readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -286,33 +288,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -355,33 +357,33 @@ client cluster OnOff = 6 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -418,23 +420,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ client cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -541,23 +543,23 @@ client cluster LevelControl = 8 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -647,7 +649,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -680,13 +682,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -694,7 +696,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -750,19 +752,19 @@ server cluster AccessControl = 31 { /** This cluster provides a standardized way for a Node (typically a Bridge, but could be any Node) to expose action information. */ server cluster Actions = 37 { - enum ActionErrorEnum : ENUM8 { + enum ActionErrorEnum : enum8 { kUnknown = 0; kInterrupted = 1; } - enum ActionStateEnum : ENUM8 { + enum ActionStateEnum : enum8 { kInactive = 0; kActive = 1; kPaused = 2; kDisabled = 3; } - enum ActionTypeEnum : ENUM8 { + enum ActionTypeEnum : enum8 { kOther = 0; kScene = 1; kSequence = 2; @@ -772,13 +774,13 @@ server cluster Actions = 37 { kAlarm = 6; } - enum EndpointListTypeEnum : ENUM8 { + enum EndpointListTypeEnum : enum8 { kOther = 0; kRoom = 1; kZone = 2; } - bitmap CommandBits : BITMAP16 { + bitmap CommandBits : bitmap16 { kInstantAction = 0x1; kInstantActionWithTransition = 0x2; kStartAction = 0x4; @@ -837,7 +839,7 @@ server cluster Actions = 37 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -861,7 +863,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -928,7 +930,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -943,7 +945,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -958,12 +960,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -983,13 +985,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -1004,7 +1006,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -1040,7 +1042,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -1054,20 +1056,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -1151,38 +1153,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -1261,7 +1263,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ client cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1269,7 +1271,7 @@ client cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1328,7 +1330,7 @@ client cluster GeneralCommissioning = 48 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -1336,7 +1338,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -1392,7 +1394,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -1408,7 +1410,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -1417,13 +1419,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1532,7 +1542,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1542,7 +1552,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1556,7 +1566,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1564,14 +1574,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1637,8 +1647,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1666,24 +1676,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ client cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1693,7 +1703,7 @@ client cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1835,19 +1845,19 @@ client cluster ThreadNetworkDiagnostics = 53 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1857,7 +1867,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1998,19 +2008,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -2019,7 +2029,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -2029,7 +2039,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2072,7 +2082,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -2085,7 +2095,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -2106,7 +2116,7 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This Cluster serves two purposes towards a Node communicating with a Bridge: indicate that the functionality on @@ -2114,7 +2124,7 @@ server cluster EthernetNetworkDiagnostics = 55 { collection of attributes that the Node MAY collect to aid in conveying information regarding the Bridged Device to a user, such as the vendor name, the model name, or user-assigned name. */ server cluster BridgedDeviceBasicInformation = 57 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -2138,7 +2148,7 @@ server cluster BridgedDeviceBasicInformation = 57 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -2194,7 +2204,7 @@ server cluster BridgedDeviceBasicInformation = 57 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ client cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2247,7 +2257,7 @@ client cluster Switch = 59 { Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -2298,21 +2308,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2325,7 +2339,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -2339,12 +2353,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ client cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -2386,12 +2400,12 @@ client cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } request struct CertificateChainRequestRequest { @@ -2399,11 +2413,11 @@ client cluster OperationalCredentials = 62 { } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } @@ -2413,9 +2427,9 @@ client cluster OperationalCredentials = 62 { } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -2428,7 +2442,7 @@ client cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } request struct UpdateFabricLabelRequest { @@ -2463,12 +2477,12 @@ client cluster OperationalCredentials = 62 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -2510,7 +2524,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -2518,14 +2532,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -2548,12 +2562,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -2564,7 +2578,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -2579,12 +2593,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -2716,7 +2730,7 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2754,7 +2768,7 @@ client cluster ModeSelect = 80 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -2790,7 +2804,7 @@ server cluster ModeSelect = 80 { /** An interface to a generic way to secure a door */ client cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -2801,13 +2815,13 @@ client cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -2816,20 +2830,20 @@ client cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -2844,7 +2858,7 @@ client cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -2854,7 +2868,7 @@ client cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -2872,7 +2886,7 @@ client cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -2882,21 +2896,21 @@ client cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2905,7 +2919,7 @@ client cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -2914,7 +2928,7 @@ client cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -2928,7 +2942,7 @@ client cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -2936,7 +2950,7 @@ client cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -2944,7 +2958,7 @@ client cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -2952,7 +2966,7 @@ client cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -2965,13 +2979,13 @@ client cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2984,7 +2998,7 @@ client cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2994,19 +3008,19 @@ client cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -3015,7 +3029,7 @@ client cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3026,7 +3040,7 @@ client cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3034,14 +3048,14 @@ client cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -3055,7 +3069,7 @@ client cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3065,13 +3079,13 @@ client cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3081,7 +3095,7 @@ client cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3091,7 +3105,7 @@ client cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -3099,7 +3113,7 @@ client cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3109,7 +3123,7 @@ client cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -3410,7 +3424,7 @@ client cluster DoorLock = 257 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -3421,13 +3435,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -3436,20 +3450,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -3464,7 +3478,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -3474,7 +3488,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -3492,7 +3506,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -3502,21 +3516,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -3525,7 +3539,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -3534,7 +3548,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -3548,7 +3562,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -3556,7 +3570,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -3564,7 +3578,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -3572,7 +3586,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -3585,13 +3599,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -3604,7 +3618,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3614,19 +3628,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -3635,7 +3649,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3646,7 +3660,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3654,14 +3668,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -3675,7 +3689,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3685,13 +3699,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -3701,7 +3715,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -3711,7 +3725,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -3719,7 +3733,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -3729,7 +3743,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -3910,7 +3924,7 @@ server cluster DoorLock = 257 { /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -3938,7 +3952,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -3952,7 +3966,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -3962,7 +3976,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -3970,20 +3984,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; @@ -4050,7 +4064,7 @@ server cluster WindowCovering = 258 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -4059,14 +4073,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -4076,9 +4090,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -4172,13 +4186,13 @@ server cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ client cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -4187,13 +4201,13 @@ client cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -4205,7 +4219,7 @@ client cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -4216,7 +4230,7 @@ client cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4226,7 +4240,7 @@ client cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -4329,13 +4343,13 @@ client cluster Thermostat = 513 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -4344,13 +4358,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -4362,7 +4376,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -4373,7 +4387,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -4383,7 +4397,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } @@ -4478,53 +4492,53 @@ server cluster ThermostatUserInterfaceConfiguration = 516 { /** Attributes and commands for controlling the color properties of a color-capable light. */ client cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -4532,14 +4546,14 @@ client cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -4796,53 +4810,53 @@ client cluster ColorControl = 768 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -4850,14 +4864,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -5095,7 +5109,7 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring the measurement of illuminance, and reporting illuminance measurements. */ server cluster IlluminanceMeasurement = 1024 { - enum LightSensorTypeEnum : ENUM8 { + enum LightSensorTypeEnum : enum8 { kPhotodiode = 0; kCMOS = 1; } @@ -5115,10 +5129,10 @@ server cluster IlluminanceMeasurement = 1024 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ client cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute optional int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute optional temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5129,10 +5143,10 @@ client cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5143,7 +5157,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -5208,18 +5222,18 @@ server cluster RelativeHumidityMeasurement = 1029 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; @@ -5247,17 +5261,17 @@ server cluster OccupancySensing = 1030 { /** This cluster provides an interface for controlling the current Channel on a device. */ client cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -5315,17 +5329,17 @@ client cluster Channel = 1284 { /** This cluster provides an interface for controlling the current Channel on a device. */ server cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -5375,7 +5389,7 @@ server cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ client cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -5411,7 +5425,7 @@ client cluster TargetNavigator = 1285 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ server cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -5434,7 +5448,7 @@ server cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ client cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -5443,14 +5457,14 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -5517,7 +5531,7 @@ client cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ server cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -5526,14 +5540,14 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -5589,7 +5603,7 @@ server cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ client cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -5604,15 +5618,15 @@ client cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -5640,12 +5654,12 @@ client cluster MediaInput = 1287 { /** Upon receipt, this SHALL hide the input list from the screen. */ command HideInputStatus(): DefaultSuccess = 2; /** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */ - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ server cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -5660,15 +5674,15 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -5692,7 +5706,7 @@ server cluster MediaInput = 1287 { command SelectInput(SelectInputRequest): DefaultSuccess = 0; command ShowInputStatus(): DefaultSuccess = 1; command HideInputStatus(): DefaultSuccess = 2; - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for managing low power mode on a device. */ @@ -5710,7 +5724,7 @@ client cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ client cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -5799,13 +5813,13 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -5832,7 +5846,7 @@ client cluster KeypadInput = 1289 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ server cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -5921,13 +5935,13 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -5943,18 +5957,18 @@ server cluster KeypadInput = 1289 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -5971,12 +5985,12 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -6051,18 +6065,18 @@ client cluster ContentLauncher = 1290 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -6079,12 +6093,12 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -6157,7 +6171,7 @@ server cluster ContentLauncher = 1290 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ client cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -6166,18 +6180,18 @@ client cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; - readonly attribute optional int8u currentOutput = 1; + readonly attribute int8u currentOutput = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6197,12 +6211,12 @@ client cluster AudioOutput = 1291 { /** Upon receipt, this SHALL change the output on the media device to the output at a specific index in the Output List. */ command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; /** Upon receipt, this SHALL rename the output at a specific index in the Output List. Updates to the output name SHALL appear in the TV settings menus. */ - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ server cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -6211,14 +6225,14 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; @@ -6240,18 +6254,18 @@ server cluster AudioOutput = 1291 { } command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -6302,13 +6316,13 @@ client cluster ApplicationLauncher = 1292 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -6334,7 +6348,7 @@ server cluster ApplicationLauncher = 1292 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ client cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -6348,12 +6362,12 @@ client cluster ApplicationBasic = 1293 { readonly attribute optional char_string<32> vendorName = 0; readonly attribute optional vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute optional int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6364,7 +6378,7 @@ client cluster ApplicationBasic = 1293 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ server cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -6378,12 +6392,12 @@ server cluster ApplicationBasic = 1293 { readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -7329,10 +7343,12 @@ endpoint 1 { ram attribute currentGroup default = 0x0000; ram attribute sceneValid default = 0x00; ram attribute nameSupport; + ram attribute sceneTableSize default = 16; + callback attribute remainingCapacity default = 8; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 5; handle command AddScene; diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index f2158750097edc..88191b28ef9110 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -5106,7 +5106,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -11202,7 +11202,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11867,6 +11867,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -12054,6 +12055,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "16", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "8", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -12112,7 +12145,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14948,5 +14981,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.cpp b/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.cpp new file mode 100644 index 00000000000000..9cfddd6f3de9fa --- /dev/null +++ b/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.cpp @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AmebaTestEventTriggerDelegate.h" +#include "SmokeCOAlarmManager.h" + +using namespace ::chip::DeviceLayer; + +namespace chip { + +bool AmebaTestEventTriggerDelegate::DoesEnableKeyMatch(const ByteSpan & enableKey) const +{ + return !mEnableKey.empty() && mEnableKey.data_equal(enableKey); +} + +CHIP_ERROR AmebaTestEventTriggerDelegate::HandleEventTrigger(uint64_t eventTrigger) +{ + bool success = emberAfHandleEventTrigger(eventTrigger); + return success ? CHIP_NO_ERROR : CHIP_ERROR_INVALID_ARGUMENT; +} + +} // namespace chip diff --git a/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.h b/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.h new file mode 100644 index 00000000000000..d461194de9b642 --- /dev/null +++ b/examples/platform/ameba/test_event_trigger/AmebaTestEventTriggerDelegate.h @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "SmokeCOAlarmManager.h" +#include + +namespace chip { + +class AmebaTestEventTriggerDelegate : public TestEventTriggerDelegate +{ +public: + explicit AmebaTestEventTriggerDelegate(const ByteSpan & enableKey) : mEnableKey(enableKey) {} + + /** + * @brief Checks to see if `enableKey` provided matches value chosen by the manufacturer. + * @param enableKey Buffer of the key to verify. + * @return True or False. + */ + bool DoesEnableKeyMatch(const ByteSpan & enableKey) const override; + + /** + * @brief User handler for handling the test event trigger based on `eventTrigger` provided. + * @param eventTrigger Event trigger to handle. + * @return CHIP_NO_ERROR on success or CHIP_ERROR_INVALID_ARGUMENT on failure. + */ + CHIP_ERROR HandleEventTrigger(uint64_t eventTrigger) override; + +private: + ByteSpan mEnableKey; +}; + +} // namespace chip + +/** + * @brief User handler for handling the test event trigger + * + * @note If TestEventTrigger is enabled, it needs to be implemented in the app + * + * @param eventTrigger Event trigger to handle + * + * @retval true on success + * @retval false if error happened + */ +bool emberAfHandleEventTrigger(uint64_t eventTrigger); diff --git a/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp b/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp index 55748704056a82..2326ff96bbec4d 100644 --- a/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp +++ b/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp @@ -53,6 +53,8 @@ extern "C" { #include #if CHIP_DEVICE_LAYER_TARGET_BL602 #include +#elif CHIP_DEVICE_LAYER_TARGET_BL702L +#include #endif #if CHIP_DEVICE_LAYER_TARGET_BL702L @@ -373,9 +375,10 @@ extern "C" void app_init(void) bl_sys_early_init(); #if CHIP_DEVICE_LAYER_TARGET_BL702L + bl_flash_init(); + rom_freertos_init(256, 400); rom_hal_init(); - rom_lmac154_hook_init(); #endif hosal_uart_init(&uart_stdio); diff --git a/examples/platform/nrfconnect/util/include/FabricTableDelegate.h b/examples/platform/nrfconnect/util/include/FabricTableDelegate.h index 01b5e40be86d16..fa9e6f0c828ad6 100644 --- a/examples/platform/nrfconnect/util/include/FabricTableDelegate.h +++ b/examples/platform/nrfconnect/util/include/FabricTableDelegate.h @@ -18,8 +18,6 @@ #pragma once -#include "AppTask.h" - #include #include #ifdef CONFIG_CHIP_WIFI @@ -42,36 +40,49 @@ class AppFabricTableDelegate : public chip::FabricTable::Delegate #ifndef CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE static AppFabricTableDelegate sAppFabricDelegate; chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAppFabricDelegate); + k_timer_init(&sFabricRemovedTimer, &OnFabricRemovedTimerCallback, nullptr); #endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE } private: void OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) + { + k_timer_start(&sFabricRemovedTimer, K_MSEC(CONFIG_CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY), K_NO_WAIT); + } + + static void OnFabricRemovedTimerCallback(k_timer * timer) { #ifndef CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) { + chip::DeviceLayer::PlatformMgr().ScheduleWork([](intptr_t) { #ifdef CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT - chip::Server::GetInstance().ScheduleFactoryReset(); + chip::Server::GetInstance().ScheduleFactoryReset(); #elif defined(CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY) || defined(CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START) - chip::DeviceLayer::PlatformMgr().ScheduleWork([](intptr_t) { - /* Erase Matter data */ + // Erase Matter data chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset(); - /* Erase Network credentials and disconnect */ + // Erase Network credentials and disconnect chip::DeviceLayer::ConnectivityMgr().ErasePersistentInfo(); #ifdef CONFIG_CHIP_WIFI chip::DeviceLayer::WiFiManager::Instance().Disconnect(); chip::DeviceLayer::ConnectivityMgr().ClearWiFiStationProvision(); #endif #ifdef CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START - /* Start the New BLE advertising */ - AppEvent event; - event.Handler = AppTask::StartBLEAdvertisementHandler; - AppTask::Instance().PostEvent(event); + // Start the New BLE advertising + if (!chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()) + { + if (CHIP_NO_ERROR == chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow()) + { + return; + } + } + ChipLogError(FabricProvisioning, "Could not start Bluetooth LE advertising"); #endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START - }); #endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT + }); } #endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE } + + inline static k_timer sFabricRemovedTimer; }; diff --git a/examples/platform/nxp/common/OTARequestorInitiator.cpp b/examples/platform/nxp/common/OTARequestorInitiator.cpp new file mode 100644 index 00000000000000..a7a898bb3718d1 --- /dev/null +++ b/examples/platform/nxp/common/OTARequestorInitiator.cpp @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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 "OTARequestorInitiator.h" + +extern "C" { +#include "mflash_drv.h" +} + +using namespace chip; + +void OTARequestorInitiator::InitOTA(intptr_t context) +{ + auto * otaRequestorInit = reinterpret_cast(context); + // Set the global instance of the OTA requestor core component + SetRequestorInstance(&otaRequestorInit->gRequestorCore); + + otaRequestorInit->gRequestorStorage.Init(chip::Server::GetInstance().GetPersistentStorage()); + otaRequestorInit->gRequestorCore.Init(chip::Server::GetInstance(), otaRequestorInit->gRequestorStorage, + otaRequestorInit->gRequestorUser, otaRequestorInit->gDownloader); + otaRequestorInit->gRequestorUser.Init(&otaRequestorInit->gRequestorCore, &otaRequestorInit->gImageProcessor); + otaRequestorInit->gImageProcessor.SetOTADownloader(&otaRequestorInit->gDownloader); + + // Set the image processor instance used for handling image being downloaded + otaRequestorInit->gDownloader.SetImageProcessorDelegate(&otaRequestorInit->gImageProcessor); +} + +void OTARequestorInitiator::HandleSelfTest() +{ + /* If application is in test mode after an OTA update + mark image as "ok" to switch the update state to permanent + (if we have arrived this far, the bootloader had validated the image) */ + + mflash_drv_init(); + + OtaImgState_t update_state; + + /* Retrieve current update state */ + update_state = OTA_GetImgState(); + + if (update_state == OtaImgState_RunCandidate) + { + if (OTA_UpdateImgState(OtaImgState_Permanent) != gOtaSuccess_c) + { + ChipLogError(SoftwareUpdate, "Self-testing : Failed to switch update state to permanent"); + return; + } + + ChipLogProgress(SoftwareUpdate, "Successful software update... applied permanently"); + } + + OTA_Initialize(); + + /* If the image is not marked ok, the bootloader will automatically revert back to primary application at next reboot */ +} diff --git a/examples/platform/nxp/common/OTARequestorInitiator.h b/examples/platform/nxp/common/OTARequestorInitiator.h new file mode 100644 index 00000000000000..808a58d03dfe91 --- /dev/null +++ b/examples/platform/nxp/common/OTARequestorInitiator.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * Copyright 2023 NXP + * 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 "app/clusters/ota-requestor/BDXDownloader.h" +#include "app/clusters/ota-requestor/DefaultOTARequestor.h" +#include "app/clusters/ota-requestor/DefaultOTARequestorDriver.h" +#include "app/clusters/ota-requestor/DefaultOTARequestorStorage.h" +#include "platform/nxp/common/OTAImageProcessorImpl.h" +#include + +using namespace chip; + +class OTARequestorInitiator +{ +public: + static OTARequestorInitiator & Instance(void) + { + static OTARequestorInitiator gOTARequestorInitiator; + return gOTARequestorInitiator; + } + /* Initialize OTA components */ + static void InitOTA(intptr_t context); + /* Handle update under test */ + static void HandleSelfTest(); + + /* OTA components */ + DefaultOTARequestor gRequestorCore; + DefaultOTARequestorStorage gRequestorStorage; + DeviceLayer::DefaultOTARequestorDriver gRequestorUser; + BDXDownloader gDownloader; + OTAImageProcessorImpl gImageProcessor; +}; diff --git a/examples/platform/nxp/common/app/support/BUILD.gn b/examples/platform/nxp/common/app/support/BUILD.gn new file mode 100644 index 00000000000000..c4ff97f4ee3d0c --- /dev/null +++ b/examples/platform/nxp/common/app/support/BUILD.gn @@ -0,0 +1,49 @@ +# 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/nxp_sdk.gni") + +config("support_config") { + include_dirs = [ "../../.." ] + + # Link options that provides replace dynamic memory operations in standard + # library with the FreeRTOS malloc in platform code. + ldflags = [ + # memory allocation -- these must be re-entrant and do locking + "-Wl,--wrap=malloc", + "-Wl,--wrap=free", + "-Wl,--wrap=realloc", + "-Wl,--wrap=calloc", + "-Wl,--wrap=MemoryAlloc", + "-Wl,--wrap=exit", + "-Wl,--wrap=printf", + + # Wrap these in case internal newlib call them (e.g. strdup will) + # directly call _malloc_r) + "-Wl,--wrap=_malloc_r", + "-Wl,--wrap=_realloc_r", + "-Wl,--wrap=_free_r", + "-Wl,--wrap=_calloc_r", + ] +} + +source_set("freertos_memory_utils") { + sources = [ "Memconfig.cpp" ] + cflags = [ "-Wconversion" ] + + deps = [ "${nxp_sdk_build_root}:nxp_sdk" ] + + public_configs = [ ":support_config" ] +} diff --git a/examples/platform/nxp/common/app/support/Memconfig.cpp b/examples/platform/nxp/common/app/support/Memconfig.cpp new file mode 100644 index 00000000000000..65c9008f453916 --- /dev/null +++ b/examples/platform/nxp/common/app/support/Memconfig.cpp @@ -0,0 +1,210 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * Copyright 2023 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file contains platform specific implementations for stdlib malloc/calloc/realloc/free + * functions, so that CHIPPlatformMemory* works as intended with the platform's heap. + */ + +#include "FreeRTOS.h" +#include "fsl_debug_console.h" +#include "task.h" +#include +#include +#include + +#ifndef NDEBUG +#include +#include +#endif + +#if CHIP_CONFIG_MEMORY_DEBUG_DMALLOC +#include +#include +#endif // CHIP_CONFIG_MEMORY_DEBUG_DMALLOC + +/* Assumes 8bit bytes! */ +#define heapBITS_PER_BYTE ((size_t) 8) + +/* Define the linked list structure. This is used to link free blocks in order +of their memory address. */ +typedef struct A_BLOCK_LINK +{ + struct A_BLOCK_LINK * pxNextFreeBlock; /*<< The next free block in the list. */ + size_t xBlockSize; /*<< The size of the free block. */ +} BlockLink_t; + +/* The size of the structure placed at the beginning of each allocated memory +block must by correctly byte aligned. */ +static const size_t xHeapStructSize = + (sizeof(BlockLink_t) + ((size_t) (portBYTE_ALIGNMENT - 1))) & ~((size_t) portBYTE_ALIGNMENT_MASK); + +/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize +member of an BlockLink_t structure is set then the block belongs to the +application. When the bit is free the block is still part of the free heap +space. */ +static size_t xBlockAllocatedBit = ((size_t) 1) << ((sizeof(size_t) * heapBITS_PER_BYTE) - 1); + +extern "C" { + +/* xPortMallocUsableSize relies on heap4 implementation. +It returns the size of an allocated block and it is +called by __wrap_realloc. +Thus it is validated in __wrap_realloc function that the allocated size +of the old_ptr is smaller than the allocated size of new_ptr */ +size_t xPortMallocUsableSize(void * pv) +{ + uint8_t * puc = (uint8_t *) pv; + BlockLink_t * pxLink; + void * voidp; + size_t sz = 0; + + if (pv != NULL) + { + vTaskSuspendAll(); + { + /* The memory being checked will have an BlockLink_t structure immediately + before it. */ + puc -= xHeapStructSize; + + /* This casting is to keep the compiler from issuing warnings. */ + voidp = (void *) puc; + pxLink = (BlockLink_t *) voidp; + + /* Check if the block is actually allocated. */ + configASSERT((pxLink->xBlockSize & xBlockAllocatedBit) != 0); + configASSERT(pxLink->pxNextFreeBlock == NULL); + + sz = (pxLink->xBlockSize & ~xBlockAllocatedBit) - xHeapStructSize; + } + (void) xTaskResumeAll(); + } + + return sz; +} + +void * __wrap_malloc(size_t size) +{ + return pvPortMalloc(size); +} + +void * operator new(size_t size) +{ + return pvPortMalloc(size); +} + +void operator delete(void * p) +{ + vPortFree(p); +} + +void operator delete(void * p, unsigned int size) +{ + vPortFree(p); +} + +void __wrap_free(void * ptr) +{ + vPortFree(ptr); +} + +void * __wrap_calloc(size_t num, size_t size) +{ + size_t total_size = num * size; + + // Handle overflow from (num * size) + if ((size != 0) && ((total_size / size) != num)) + { + return nullptr; + } + + void * ptr = pvPortMalloc(total_size); + if (ptr) + { + memset(ptr, 0, total_size); + } + + return ptr; +} + +void * __wrap_realloc(void * ptr, size_t new_size) +{ + + void * new_ptr = NULL; + + if (new_size) + { + size_t old_ptr_size = xPortMallocUsableSize(ptr); + if (new_size <= old_ptr_size) + { + /* Return old pointer if the newly allocated size is smaller + or equal to the allocated size for old_ptr */ + return ptr; + } + + /* if old_ptr is NULL, then old_ptr_size is zero and new_ptr will be returned */ + new_ptr = pvPortMalloc(new_size); + + if (!new_ptr) + { + return NULL; + } + + memset(reinterpret_cast(new_ptr) + old_ptr_size, 0, (new_size - old_ptr_size)); + memcpy(new_ptr, ptr, old_ptr_size); + } + + vPortFree(ptr); + + return new_ptr; +} + +void * __wrap__malloc_r(void * REENT, size_t size) +{ + return __wrap_malloc(size); +} + +void __wrap__free_r(void * REENT, void * ptr) +{ + __wrap_free(ptr); +} + +void * __wrap__realloc_r(void * REENT, void * ptr, size_t new_size) +{ + return __wrap_realloc(ptr, new_size); +} + +void * __wrap__calloc_r(void * REENT, size_t num, size_t size) +{ + return __wrap_calloc(num, size); +} + +int __wrap_printf(const char * fmt_s, ...) +{ + int res = 0; + va_list args; + + va_start(args, fmt_s); + res = DbgConsole_Vprintf(fmt_s, args); + va_end(args); + return res; +} + +} // extern "C" diff --git a/examples/platform/nxp/rt/rw61x/BUILD.gn b/examples/platform/nxp/rt/rw61x/BUILD.gn new file mode 100644 index 00000000000000..cb797b30e5c75f --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2020-2022 Project CHIP Authors +# Copyright 2023 NXP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/nxp_sdk.gni") + +config("chip_app_project_config") { + include_dirs = [ + "app/project_include", + "../../common/util/include", + "../../common/mbedtls", + ] +} diff --git a/examples/platform/nxp/rt/rw61x/app/ldscripts/RW610_flash.ld b/examples/platform/nxp/rt/rw61x/app/ldscripts/RW610_flash.ld new file mode 100644 index 00000000000000..e3b51876eca963 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/app/ldscripts/RW610_flash.ld @@ -0,0 +1,584 @@ +/* +** ################################################################### +** Processors: RW610EVA0IK +** RW610EVA0IMP +** RW610HNA0IK +** RW610HNA0IMP +** RW610UKA0IZ +** +** Compiler: GNU C Compiler +** Reference manual: RW61X User manual Rev. 0.95, June 2022 +** Version: rev. 1.0, 2021-03-16 +** Build: b220615 +** +** Abstract: +** Linker file for the GNU C Compiler +** +** Copyright 2016 Freescale Semiconductor, Inc. +** Copyright 2016-2023 NXP +** All rights reserved. +** +** SPDX-License-Identifier: BSD-3-Clause +** +** http: www.nxp.com +** mail: support@nxp.com +** +** ################################################################### +*/ + +/** + * @file + * Linker instructions for RW610 + */ + +/** If OTA is enabled : MCUBoot bootloader resides at the base of the flash and occupies 0x20000 (128 kBytes) + slot 0 : main application partition (active app) + slot0 = header + ivt + m_app_cpu3 + fw_storage (cpu1/cpu2 fw) + trailer + slot 1 : OTA Update storage partition (candidate app) + slot1 = OTA image (the image received is already wrapped with header & trailer) +**/ + +/************************ Flash Layout with OTA enabled ********************* + + 0x0800_0000 FLASH_START + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + | | + | MCUBoot | + 128k | bootloader | + | | + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + 4k | Header_slot0 | ' + +---------------+ m_interrupts_start ' + | m_interrupts | ' ' + +---------------+ m_text_start ' ' + | | ' m_app_cpu3 ' + m_app_ | | ' + ' +_stated_ | m_text | ' fw_storage ' ACTIVE_APP (slot 0) + _size | | ' ' (4.4 MB) + | | ' ' + | | ' ' + +---------------+ m_text_end ' ' + 4k | Trailer_slot0 | ' + +---------------+ ' + 4k | padding | ' + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + | | FW_UPDATE_STORAGE_START ' + | | ' + | | ' + | | ' + | | ' + | OTA | ' + | Update | ' CANDIDATE_APP (slot 1) + | Image | ' (4.4 MB) + | | ' + | | ' + | | ' + | | ' + | | FW_UPDATE_STORAGE_END ' + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + 4k | FactoryData | + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + | | NV_STORAGE_START_ADDRESS + | NVM_region | + | | NV_STORAGE_END_ADDRESS + - - - +---------------+ - - - - - - - - - - - - - - - - - - - - + 0x0C00_0000 FLASH_END + +*****************************************************************************/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0; +STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0A00; +M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x00000280 : 0; + +/* -------------------------------------------------------------------------- */ +/* FLEX SPI FLASH */ +/* -------------------------------------------------------------------------- */ + +m_flash_start = 0x08000000; +m_flash_size = 0x04000000; /* 64 MB */ +m_flash_end = m_flash_start + m_flash_size - 1; +m_sector_size = 0x1000; +m_vector_table_size = 0x280; + +m_flash_config_start = 0x08000400; +m_flash_config_size = 0xC00; +m_flash_config_end = m_flash_config_start + m_flash_config_size - 1; + +/* + * If OTA is enabled, we must reserve enough space for MCUboot and the image header. + * Note that MCUboot itself embeds the FlashConfig section. +*/ +m_mcuboot_size = DEFINED(__m_mcuboot_size__) ? __m_mcuboot_size__ : 0; /* 128 kB but 64kB could be enough */ +m_mcuboot_start = m_flash_start; /* The flash config section is comprised */ +m_mcuboot_end = m_mcuboot_start + m_mcuboot_size - 1; +m_mcuboot_img_hdr_sz = ((0x400 + (m_sector_size - 1))/m_sector_size)*m_sector_size; + +/* CPU1/CPU2 fw storage section */ +wifi_fw_size = 0xA0000; /* 640kB */ +ble_fw_size = 0x50000; /* 320kB */ +z154_fw_size = 0x50000; /* 320kB */ +/* fw_storage_size is the maximum possible size of CPU1 + CPU2 binaries. */ +fw_storage_size = (wifi_fw_size + ble_fw_size + z154_fw_size); + + +/* Active application section + * If OTA is enabled, the application starts after mcuboot app + image header. + * We reserve cpu3_app max size plus enough to store CPU1 and CPU2 apps because + * CPU1 and CPU2 binaries are embedded in app core binary. +*/ + +m_app_start = DEFINED(__m_mcuboot_size__) ? m_mcuboot_end + 1 : m_flash_config_end + 1; +m_app_trailer_size = m_sector_size; +m_padding_size = m_sector_size; + +/* Maximum number of sectors per slot */ +m_app_max_sectors = 0x440; /* (4.4MB / m_sector_size) */ + +/* The active image section contains the mcuboot header + m_interrupts + cpu3/cpu2/cpu1 apps + trailer + * The maximum image size available for the application is the (total_slot_size - m_padding_size). + * This is due to the last sector being used by mcuboot to perform the swap-move of the upgrade. +*/ +FW_ACTIVE_APP_START = m_app_start; +FW_ACTIVE_APP_OFFSET = m_app_start - m_flash_start; +FW_ACTIVE_APP_SIZE = m_sector_size * m_app_max_sectors - m_padding_size; +FW_ACTIVE_APP_END = FW_ACTIVE_APP_START + FW_ACTIVE_APP_SIZE - 1; + +/* The size of the stated application includes the sizes of cpu1/cpu2/cpu3 apps. + * Note that an empty sector (padding) must be kept at the end of the active image section, + * this would be used by mcuboot to perform a swap-move operation of the upgrade. + */ +m_app_stated_size = FW_ACTIVE_APP_SIZE - m_mcuboot_img_hdr_sz - m_app_trailer_size; + +m_interrupts_start = DEFINED(__m_mcuboot_size__) ? m_app_start + m_mcuboot_img_hdr_sz : m_app_start; +m_interrupts_end = m_interrupts_start + m_vector_table_size - 1; + +m_text_start = m_interrupts_end + 1; +m_text_size = m_app_stated_size - m_vector_table_size; +m_text_end = m_text_start + m_text_size - 1; + + + +/* Candidate application (OTA Update Image) section + * The size of the candidate image (slot 1) is equal to the active image (slot 0) size +*/ +FW_UPDATE_STORAGE_START = FW_ACTIVE_APP_END + 1 + m_padding_size; +FW_UPDATE_STORAGE_SIZE = FW_ACTIVE_APP_SIZE; +FW_UPDATE_STORAGE_OFFSET = FW_UPDATE_STORAGE_START - m_flash_start; +FW_UPDATE_STORAGE_END = FW_UPDATE_STORAGE_START + FW_UPDATE_STORAGE_SIZE - 1; + +fw_top = FW_UPDATE_STORAGE_END + 1; + +/* FileSystem Configuration */ +NV_STORAGE_END_ADDRESS = m_flash_end; +NV_STORAGE_MAX_SECTORS = DEFINED(gNVMSectorCountLink_d) ? gNVMSectorCountLink_d : 16; +NV_STORAGE_SECTOR_SIZE = m_sector_size; +NV_STORAGE_SIZE = NV_STORAGE_SECTOR_SIZE * NV_STORAGE_MAX_SECTORS; +NV_STORAGE_START_ADDRESS = NV_STORAGE_END_ADDRESS - NV_STORAGE_SIZE + 1; +NV_STORAGE_START_ADDRESS_OFFSET = NV_STORAGE_START_ADDRESS - m_flash_start; + +/*** FactoryData space 1 sector is reserved ***/ +__FACTORY_DATA_SIZE = m_sector_size; +__FACTORY_DATA_END = NV_STORAGE_START_ADDRESS -1; +__FACTORY_DATA_START = __FACTORY_DATA_END - __FACTORY_DATA_SIZE + 1; +__FACTORY_DATA_START_OFFSET = __FACTORY_DATA_START - m_flash_start; + +/* -------------------------------------------------------------------------- */ +/* RAM */ +/* -------------------------------------------------------------------------- */ + +m_data_start = 0x20000000; +m_data_size = 0x00130000; +m_data_end = 0x2012FFFF; + +/* -------------------------------------------------------------------------- */ +/* SMU1 - CPU3/CPU1 */ +/* -------------------------------------------------------------------------- */ + +m_sqram_cpu13_mbox_start = 0x41380000; +m_sqram_cpu13_mbox_size = 0x00000488; +m_sqram_cpu13_mbox_end = m_sqram_cpu13_mbox_start + m_sqram_cpu13_mbox_size - 1; + +m_sqram_cpu13_txq_start = m_sqram_cpu13_mbox_end + 1; +m_sqram_cpu13_txq_size = 0x1000; +m_sqram_cpu13_txq_end = m_sqram_cpu13_txq_start + m_sqram_cpu13_txq_size - 1; + +/* -------------------------------------------------------------------------- */ +/* SMU2 - CPU3/CPU2 */ +/* -------------------------------------------------------------------------- */ + +m_sqram_cpu23_mbox_start = 0x443C0000; +m_sqram_cpu23_mbox_size = 0x00000488; +m_sqram_cpu23_mbox_end = m_sqram_cpu23_mbox_start + m_sqram_cpu23_mbox_size - 1; + +m_sqram_cpu23_txq_start = m_sqram_cpu23_mbox_end + 1; +m_sqram_cpu23_txq_size = 0x1080; +m_sqram_cpu23_txq_end = m_sqram_cpu23_txq_start + m_sqram_cpu23_txq_size - 1; + +m_sqram_cpu32_txq_start = m_sqram_cpu23_txq_end + 1; +m_sqram_cpu32_txq_size = 0x1080; +m_sqram_cpu32_txq_end = m_sqram_cpu32_txq_start + m_sqram_cpu32_txq_size - 1; + + +/* Specify the memory areas */ +MEMORY +{ + m_flash_config (RX) : ORIGIN = m_flash_config_start, LENGTH = m_flash_config_size + m_interrupts (RX) : ORIGIN = m_interrupts_start, LENGTH = m_vector_table_size + m_text (RX) : ORIGIN = m_text_start, LENGTH = m_text_size + m_nvm_region (RW) : ORIGIN = NV_STORAGE_START_ADDRESS, LENGTH = NV_STORAGE_SIZE + m_data (RW) : ORIGIN = m_data_start, LENGTH = m_data_size + m_sqram_cpu13_mbox (RW) : ORIGIN = m_sqram_cpu13_mbox_start, LENGTH = m_sqram_cpu13_mbox_size + m_sqram_cpu13_txq (RW) : ORIGIN = m_sqram_cpu13_txq_start, LENGTH = m_sqram_cpu13_txq_size + m_sqram_cpu23_mbox (RW) : ORIGIN = m_sqram_cpu23_mbox_start, LENGTH = m_sqram_cpu23_mbox_size + m_sqram_cpu23_txq (RW) : ORIGIN = m_sqram_cpu23_txq_start, LENGTH = m_sqram_cpu23_txq_size + m_sqram_cpu32_txq (RW) : ORIGIN = m_sqram_cpu32_txq_start, LENGTH = m_sqram_cpu32_txq_size +} + + +/* Define output sections */ +SECTIONS +{ + .flash_config : ALIGN(4) + { + . = ALIGN(4); + __FLASH_BASE = .; + KEEP(* (.flash_conf)) /* flash config section */ + . = ALIGN(4); + } > m_flash_config + + /* The startup code goes first into internal ram */ + .interrupts : + { + . = ALIGN(4); + __VECTOR_TABLE = .; + __Vectors = .; + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } > m_interrupts + + /* The program code and other data goes into internal ram */ + .text : + { + . = ALIGN(4); + *(.rcs.*) + *(EXCLUDE_FILE( + *port.c.obj + *portasm.c.obj + *queue.c.obj + *timers.c.obj + *tasks.c.obj + *inet_chksum.c.obj + *ip4.c.obj + *pbuf.c.obj + *sys_arch.c.obj + *tcp_out.c.obj + *tcp_in.c.obj + *mlan_11n_rxreorder.c.obj + *mlan_wmm.c.obj + *wifi.c.obj + *wifi-imu.c.obj + *fsl_adapter_rfimu.c.obj + *fsl_cache.c.obj + *fsl_os_abstraction_free_rtos.c.obj + /* Exclude flash and frequently executed functions from XIP */ + *fsl_adapter_flexspi_nor_flash.c.o + *mflash_drv.c.o + *fsl_flexspi.c.o + ) .text*) /* .text* sections (code) */ + /*(EXCLUDE_FILE( + /* Exclude flash and frequently executed functions from XIP * + *fsl_adapter_flexspi_nor_flash.c.o + *mflash_drv.c.o + *fsl_flexspi.c.o + ).rodata*) /* .rodata* sections (constants, strings, etc.) */ + *(.rodata .rodata.* .constdata .constdata.*) + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + KEEP (*(.init)) + KEEP (*(.fini)) + . = ALIGN(4); + } > m_text + + ._bt_settings_area : + { + . = ALIGN(4); + _bt_settings_start = .; + KEEP(*(SORT(._bt_settings.static.*))) + _bt_settings_end = .; + . = ALIGN(4); + } > m_text + + ._settings_handler_static : + { + . = ALIGN(4); + _settings_handler_static_list_start = .; + KEEP(*(SORT(._settings_handler_static.static.*))) + _settings_handler_static_list_end = .; + . = ALIGN(4); + } > m_text + + ._bt_conn_cb : + { + . = ALIGN(4); + _bt_conn_cb_list_start = .; + KEEP(*(SORT(._bt_conn_cb.static.*))) + _bt_conn_cb_list_end = .; + . = ALIGN(4); + } > m_text + + ._bt_gatt_service_static : + { + . = ALIGN(4); + _bt_gatt_service_static_list_start = .; + KEEP(*(SORT(._bt_gatt_service_static.static.*))) + _bt_gatt_service_static_list_end = .; + . = ALIGN(4); + } > m_text + + ._bt_l2cap_fixed_chan : + { + . = ALIGN(4); + _bt_l2cap_fixed_chan_list_start = .; + KEEP(*(SORT(._bt_l2cap_fixed_chan.static.*))) + _bt_l2cap_fixed_chan_list_end = .; + . = ALIGN(4); + } > m_text + + ._bt_l2cap_br_fixed_chan : + { + . = ALIGN(4); + _bt_l2cap_br_fixed_chan_list_start = .; + KEEP(*(SORT(._bt_l2cap_br_fixed_chan.static.*))) + _bt_l2cap_br_fixed_chan_list_end = .; + . = ALIGN(4); + } > m_text + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > m_text + + .ARM : + { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } > m_text + + .ctors : + { + __CTOR_LIST__ = .; + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*crtbegin?.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + __CTOR_END__ = .; + } > m_text + + .dtors : + { + __DTOR_LIST__ = .; + KEEP (*crtbegin.o(.dtors)) + KEEP (*crtbegin?.o(.dtors)) + KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + __DTOR_END__ = .; + } > m_text + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } > m_text + + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } > m_text + + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } > m_text + + __etext = .; /* define a global symbol at end of code */ + __DATA_ROM = .; /* Symbol is used by startup for data initialization */ + + .interrupts_ram : + { + . = ALIGN(4); + __VECTOR_RAM__ = .; + __interrupts_ram_start__ = .; /* Create a global symbol at data start */ + *(.m_interrupts_ram) /* This is a user defined section */ + . += M_VECTOR_RAM_SIZE; + . = ALIGN(4); + __interrupts_ram_end__ = .; /* Define a global symbol at data end */ + } > m_data + + __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts); + __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0; + + .data : AT(__DATA_ROM) + { + . = ALIGN(4); + __DATA_RAM = .; + __data_start__ = .; /* create a global symbol at data start */ + *(CodeQuickAccess) /* CodeQuickAccess sections */ + *(DataQuickAccess) /* DataQuickAccess sections */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *port.c.obj(.text*) + *portasm.c.obj(.text*) + *queue.c.obj(.text*) + *timers.c.obj(.text*) + *tasks.c.obj(.text*) + *inet_chksum.c.obj(.text*) + *ip4.c.obj(.text*) + *pbuf.c.obj(.text*) + *sys_arch.c.obj(.text*) + *tcp_out.c.obj(.text*) + *tcp_in.c.obj(.text*) + *mlan_11n_rxreorder.c.obj(.text*) + *mlan_wmm.c.obj(.text*) + *wifi.c.obj(.text*) + *wifi-imu.c.obj(.text*) + *fsl_adapter_rfimu.c.obj(.text*) + *fsl_cache.c.obj(.text*) + *fsl_os_abstraction_free_rtos.c.obj(.text*) + /* Explicit placement of flash and frequently executed functions in RAM */ + *fsl_adapter_flexspi_nor_flash.c.o(.text .text* .rodata .rodata*) + *mflash_drv.c.o(.text* .text* .rodata .rodata*) + *fsl_flexspi.c.o(.text .text* .rodata .rodata*) + KEEP(*(.jcr*)) + . = ALIGN(4); + _k_mem_slab_list_start = .; + KEEP(*(SORT(._k_mem_slab*))) + _k_mem_slab_list_end = .; + . = ALIGN(4); + _net_buf_pool_list = .; + KEEP(*(SORT(._net_buf_pool*))) + . = ALIGN(4); + __data_end__ = .; /* define a global symbol at data end */ + } > m_data + + __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); + + text_end = ORIGIN(m_text) + LENGTH(m_text); + + ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") + + _image_size = __DATA_END - __VECTOR_TABLE; + + /* Uninitialized data section */ + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + . = ALIGN(4); + __START_BSS = .; + __bss_start__ = .; + *(.bss) + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + __END_BSS = .; + } > m_data + + .heap (NOLOAD) : + { + . = ALIGN(8); + __end__ = .; + PROVIDE(end = .); + __HeapBase = .; + KEEP(*(.heap*)) + __HeapLimit = .; + __heap_limit = .; /* Add for _sbrk */ + } > m_data + + .stack : + { + . = ALIGN(8); + __StackLimit = .; + . += STACK_SIZE; + __StackTop = .; + } > m_data + + PROVIDE(__stack = __StackTop); + + .smu_cpu13_mbox (NOLOAD) : + { + . = ALIGN(4); + *(.smu_cpu13_mbox) + KEEP (*(.smu_cpu13_mbox)) + . = ALIGN(4); + } > m_sqram_cpu13_mbox + + .smu_cpu31_txq (NOLOAD) : + { + . = ALIGN(4); + *(.smu_cpu31_txq) + KEEP (*(.smu_cpu31_txq)) + . = ALIGN(4); + } > m_sqram_cpu13_txq + + .smu_cpu23_mbox (NOLOAD) : + { + . = ALIGN(4); + SQRAM_CPU23_MBOX = .; + *(.smu_cpu23_mbox) + KEEP (*(.smu_cpu23_mbox)) + . = ALIGN(4); + } > m_sqram_cpu23_mbox + + .smu_cpu32_txq (NOLOAD) : + { + . = ALIGN(4); + *(.smu_cpu32_txq) + KEEP (*(.smu_cpu32_txq)) + . = ALIGN(4); + } > m_sqram_cpu32_txq + + .NVM : + { + FILL(0xFFFFFFFF); + . = ORIGIN(m_nvm_region) + LENGTH(m_nvm_region) - 1; + BYTE(0xFF); + } > m_nvm_region + + .ARM.attributes 0 : { *(.ARM.attributes) } + + ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap") + + ASSERT( (DEFINED(__m_mcuboot_size__) ? (__m_mcuboot_size__ % m_sector_size) : 0) == 0, "mcuboot size is not aligned on flash sector size") + + ASSERT(NV_STORAGE_START_ADDRESS >= FW_UPDATE_STORAGE_END, "OTA storage section overflowed") +} diff --git a/examples/platform/nxp/rt/rw61x/app/project_include/freeRTOS/FreeRTOSConfig.h b/examples/platform/nxp/rt/rw61x/app/project_include/freeRTOS/FreeRTOSConfig.h new file mode 100644 index 00000000000000..cb7d563f756f8c --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/app/project_include/freeRTOS/FreeRTOSConfig.h @@ -0,0 +1,185 @@ +/* + * FreeRTOS Kernel V10.4.3 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK CHIP_DEVICE_CONFIG_ENABLE_WPA +#define configUSE_TICKLESS_IDLE 0 +#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (10) + +/* stack size increased for NVM/LITTLE_FS save in idle task */ +#define configMINIMAL_STACK_SIZE ((uint16_t) 2048) +#ifndef configTOTAL_HEAP_SIZE +#define configTOTAL_HEAP_SIZE ((size_t) (122 * 1024)) +#endif +#define configAPPLICATION_ALLOCATED_HEAP 1 +#define configSUPPORT_STATIC_ALLOCATION 0 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configFRTOS_MEMORY_SCHEME 4 +#define configMAX_TASK_NAME_LEN (16) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 0 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configGENERATE_RUN_TIME_STATS 0 +#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 0 +#define configRECORD_STACK_HIGH_ADDRESS 1 +/* Define to 0 to be able to get task information in MCUXpresso */ +#define configENABLE_BACKWARD_COMPATIBILITY 1 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 3) +#define configTIMER_QUEUE_LENGTH 10 + +/* set to fixed value as configMINIMAL_STACK_SIZE was increased */ +#define configTIMER_TASK_STACK_DEPTH (2048) + +/* Set the following definitions to 1 to include the API function, or zero + * to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xSemaphoreGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 + +/* Tasks.c additions (e.g. Thread Aware Debug capability) */ +#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 1 + +/* Normal assert() semantics without relying on the provision of an assert.h + * header file. */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + { \ + ; \ + } \ + } + +/* Map the FreeRTOS printf() to the logging task printf. */ +#define configPRINTF(x) vLoggingPrintf x + +/* Map the logging task's printf to the board specific output function. */ +#define configPRINT_STRING print_string + +/* Sets the length of the buffers into which logging messages are written - so + * also defines the maximum length of each log message. */ +#define configLOGGING_MAX_MESSAGE_LENGTH 256 + +/* Set to 1 to prepend each log message with a message number, the task name, + * and a time stamp. */ +#define configLOGGING_INCLUDE_TIME_AND_TASK_NAME 1 + +#define configPRE_STOP_PROCESSING vMainPreStopProcessing +#define configPOST_STOP_PROCESSING vMainPostStopProcessing + +#ifndef configENABLE_FPU +#define configENABLE_FPU 1 +#endif +#ifndef configENABLE_MPU +#define configENABLE_MPU 0 +#endif +#ifndef configENABLE_TRUSTZONE +#define configENABLE_TRUSTZONE 0 +#endif +#ifndef configRUN_FREERTOS_SECURE_ONLY +#define configRUN_FREERTOS_SECURE_ONLY 1 +#endif + +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +/* Clock manager provides in this variable system core clock frequency */ +#include +extern uint32_t SystemCoreClock; +#endif + +/* Interrupt nesting behaviour configuration. Cortex-M specific. */ +#ifdef __NVIC_PRIO_BITS +/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ +#define configPRIO_BITS __NVIC_PRIO_BITS +#else +#define configPRIO_BITS 4 /* 15 priority levels */ +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1U << (configPRIO_BITS)) - 1) + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler +#define xPortSysTickHandler SysTick_Handler + +#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h b/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h new file mode 100644 index 00000000000000..166222d1295311 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h @@ -0,0 +1,84 @@ +/* + * + * Copyright (c) 2020 Google LLC. + * Copyright 2023 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Overrides to default OpenThread configuration. + * + */ + +#pragma once + +// When operating in a less than ideal RF environment, having a more forgiving configuration +// of OpenThread makes thread a great deal more reliable. +#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY 120 // default is 28800 +#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 30 // default is 3 +#define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 1 // default is 0 +#define OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 16 // default is 4 + +// Enable periodic parent search to speed up finding a better parent. +#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 1 // default is 0 +#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD -45 // default is -65 +#define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1 // default is 0 + +// Use smaller maximum interval to speed up reattaching. +#define OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_MAXIMUM_INTERVAL (60 * 10 * 1000) // default 1200000 ms + +// disable unused features +#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 +#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 +#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 +#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 +#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 +#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0 + +// Enable usage of external heap allocator for ot +#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 + +// Disable TCP +#define OPENTHREAD_CONFIG_TCP_ENABLE 0 + +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 + +// Temporary workaround till we can enable this via the gn +#ifdef SPINEL_INTERFACE_RPMSG +#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 1 +#else +#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 0 +#endif /* SPINEL_INTERFACE_RPMSG */ + +/* + * "ot-nxp/src/rw/rw612/platform/radio.c" has a dependency on + * "examples/platforms/utils/link_metrics.cpp" which is not built in the Matter build system + * for this reason, currently we are disabling this feature + */ +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 0 +#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 0 + +// Use the NXP-supplied default platform configuration for remainder +// of OpenThread config options. +// +// NB: This file gets included during the build of OpenThread. Hence +// it cannot use "openthread" in the path to the included file. +// +#include "openthread-core-rw612-config.h" diff --git a/examples/platform/nxp/rt/rw61x/board/board.c b/examples/platform/nxp/rt/rw61x/board/board.c new file mode 100644 index 00000000000000..8d378b550477f3 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/board.c @@ -0,0 +1,395 @@ +/* + * Copyright 2021-2023 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "board.h" +#include "fsl_cache.h" +#include "fsl_clock.h" +#include "fsl_common.h" +#include "fsl_debug_console.h" +#include "fsl_flexspi.h" +#include "fsl_io_mux.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#define BOARD_FLEXSPI_DLL_LOCK_RETRY (10) + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Prototypes + ******************************************************************************/ + +/******************************************************************************* + * Code + ******************************************************************************/ +/* Initialize debug console. */ +void BOARD_InitDebugConsole(void) +{ + uint32_t uartClkSrcFreq = 0; + + /* attach FRG0 clock to FLEXCOMM3 (debug console) */ + CLOCK_SetFRGClock(BOARD_DEBUG_UART_FRG_CLK); + CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH); + + uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ; + DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); +} + +static status_t flexspi_hyper_ram_read_id(FLEXSPI_Type * base, uint16_t * buffer) +{ + flexspi_transfer_t flashXfer; + status_t status; + + /* Write data */ + flashXfer.deviceAddress = 0x00; + flashXfer.port = kFLEXSPI_PortB1; + flashXfer.cmdType = kFLEXSPI_Read; + flashXfer.SeqNumber = 1; + flashXfer.seqIndex = 15; + flashXfer.data = (uint32_t *) buffer; + flashXfer.dataSize = 2; + + status = FLEXSPI_TransferBlocking(base, &flashXfer); + + return status; +} + +static status_t flexspi_hyper_ram_read_register(FLEXSPI_Type * base, uint32_t address, uint16_t * buffer) +{ + flexspi_transfer_t flashXfer; + status_t status; + + /* Write data */ + flashXfer.deviceAddress = address; + flashXfer.port = kFLEXSPI_PortB1; + flashXfer.cmdType = kFLEXSPI_Read; + flashXfer.SeqNumber = 1; + flashXfer.seqIndex = 13; + flashXfer.data = (uint32_t *) buffer; + flashXfer.dataSize = 2; + + status = FLEXSPI_TransferBlocking(base, &flashXfer); + + return status; +} + +static status_t flexspi_hyper_ram_write_register(FLEXSPI_Type * base, uint32_t address, uint16_t * buffer) +{ + flexspi_transfer_t flashXfer; + status_t status; + + /* Write data */ + flashXfer.deviceAddress = address; + flashXfer.port = kFLEXSPI_PortB1; + flashXfer.cmdType = kFLEXSPI_Write; + flashXfer.SeqNumber = 1; + flashXfer.seqIndex = 14; + flashXfer.data = (uint32_t *) buffer; + flashXfer.dataSize = 2; + + status = FLEXSPI_TransferBlocking(base, &flashXfer); + + return status; +} + +/* Initialize psram. */ +status_t BOARD_InitPsRam(void) +{ + flexspi_device_config_t deviceconfig = { + .flexspiRootClk = 320000000, /* 320MHZ SPI serial clock, DDR serial clock 160M */ + .isSck2Enabled = false, + .flashSize = 0x1000, /* 32Mb/KByte */ + .addressShift = true, + .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle, + .CSInterval = 5, + .CSHoldTime = 2, + .CSSetupTime = 3, + .dataValidTime = 1, + .columnspace = 9 + 5, /* CA:9 + CA_SHIFT:5 */ + .enableWordAddress = false, + .AWRSeqIndex = 12, + .AWRSeqNumber = 1, + .ARDSeqIndex = 11, + .ARDSeqNumber = 1, + .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle, + .AHBWriteWaitInterval = 0, + .enableWriteMask = true, + }; + + uint32_t customLUT[20] = { + /* Read Data */ + [0] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0xAA, kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x00), + [1] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_4PAD, 16, kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_4PAD, 16), + [2] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DUMMY_DDR, kFLEXSPI_4PAD, 28, kFLEXSPI_Command_READ_DDR, kFLEXSPI_4PAD, 0x01), + + /* Write Data */ + [4] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x22, kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x00), + [5] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_4PAD, 16, kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_4PAD, 16), + [6] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DUMMY_DDR, kFLEXSPI_4PAD, 28, kFLEXSPI_Command_WRITE_DDR, kFLEXSPI_4PAD, 0x01), + + /* Read Register */ + [8] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0xCC, kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x00), + [9] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_4PAD, 16, kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_4PAD, 16), + [10] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DUMMY_DDR, kFLEXSPI_4PAD, 12, kFLEXSPI_Command_READ_DDR, kFLEXSPI_4PAD, 0x01), + + /* Write Register */ + [12] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x66, kFLEXSPI_Command_DDR, kFLEXSPI_4PAD, 0x00), + [13] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_4PAD, 16, kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_4PAD, 16), + [14] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_DDR, kFLEXSPI_4PAD, 0x01, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), + + /* Read ID */ + [16] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_4PAD, 0xE0, kFLEXSPI_Command_RADDR_DDR, kFLEXSPI_4PAD, 16), + [17] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_CADDR_DDR, kFLEXSPI_4PAD, 16, kFLEXSPI_Command_DUMMY_RWDS_DDR, kFLEXSPI_4PAD, 0x08), + [18] = FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_DDR, kFLEXSPI_4PAD, 0x01, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x00), + }; + + flexspi_config_t config; +#if BOARD_ENABLE_PSRAM_CACHE + cache64_config_t cacheCfg; +#endif + status_t status = kStatus_Success; + + if (!BOARD_IS_XIP()) /* FlexSPI not initialized */ + { + CLOCK_EnableClock(kCLOCK_Flexspi); + RESET_ClearPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn); + BOARD_SetFlexspiClock(FLEXSPI, 5U, 1U); + + /* Get FLEXSPI default settings and configure the flexspi. */ + FLEXSPI_GetDefaultConfig(&config); + + /* Init FLEXSPI. */ + config.rxSampleClock = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad; + config.rxSampleClockPortB = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad; + config.rxSampleClockDiff = true; + /*Set AHB buffer size for reading data through AHB bus. */ + config.ahbConfig.enableAHBPrefetch = true; + config.ahbConfig.enableAHBBufferable = true; + config.ahbConfig.enableAHBCachable = true; + config.ahbConfig.enableReadAddressOpt = true; + for (uint8_t i = 1; i < FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1; i++) + { + config.ahbConfig.buffer[i].bufferSize = 0; + } + /* FlexSPI has total 1KB RX buffer. + * Set DMA0 master to use AHB Rx Buffer0. + */ + config.ahbConfig.buffer[0].masterIndex = 10; /* GDMA */ + config.ahbConfig.buffer[0].bufferSize = 512; /* Allocate 512B bytes for DMA0 */ + config.ahbConfig.buffer[0].enablePrefetch = true; + config.ahbConfig.buffer[0].priority = 0; + /* All other masters use last buffer with 512B bytes. */ + config.ahbConfig.buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1].bufferSize = 512; +#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) + config.enableCombination = false; +#endif + FLEXSPI_Init(BOARD_FLEXSPI_PSRAM, &config); + } + + /* Configure flash settings according to serial flash feature. */ + FLEXSPI_SetFlashConfig(BOARD_FLEXSPI_PSRAM, &deviceconfig, kFLEXSPI_PortB1); + + /* Update bottom LUT table (44-63). */ + FLEXSPI_UpdateLUT(BOARD_FLEXSPI_PSRAM, 44U, customLUT, ARRAY_SIZE(customLUT)); + + /* Do software reset. */ + FLEXSPI_SoftwareReset(BOARD_FLEXSPI_PSRAM); + + /* Read identification: the Manufacturer ID of ISSI's PSRAM(IS66/67WVQ8M4DALL) is 0x03U */ + uint16_t identification = 0x00U; + uint16_t registerVal = 0x00U; + status = flexspi_hyper_ram_read_id(BOARD_FLEXSPI_PSRAM, &identification); + if ((status != kStatus_Success) || (identification & 0x03U) != 0x03U) + { + status = kStatus_Fail; + } + + /* Read configuration register: the default setting is 0xF052(see table 6.1 Configuration Register in + PSRAM's(IS66/67WVQ8M4DALL) datasheet), which Latency code(CR[7:4]) is 0101b, which supported max frequency is + 200MHz.*/ + status = flexspi_hyper_ram_read_register(BOARD_FLEXSPI_PSRAM, 0x04U << 9, ®isterVal); + if ((status != kStatus_Success) || registerVal != 0xF052) + { + status = kStatus_Fail; + } + + /* Initial access latency configuration, which is located in bit3 of CR. */ + registerVal |= 0x01UL << 3; + + /* Write configuration register: */ + status = flexspi_hyper_ram_write_register(BOARD_FLEXSPI_PSRAM, 0x04U << 9, ®isterVal); + if ((status != kStatus_Success) || registerVal != 0xF05A) + { + status = kStatus_Fail; + } + + /* Reset */ + registerVal = 0x00U; + + /* Read configuration register: changes default Variable Latency into Fixed Latency: 0xF05A. + Note: FlexSPI only supports fixed latency mode for ISSI's psram. */ + status = flexspi_hyper_ram_read_register(BOARD_FLEXSPI_PSRAM, 0x04U << 9, ®isterVal); + if ((status != kStatus_Success) || registerVal != 0xF05A) + { + status = kStatus_Fail; + } + +#if BOARD_ENABLE_PSRAM_CACHE + CACHE64_GetDefaultConfig(&cacheCfg); + /* Suppose: + Flash on PC bus starting from 0x08000000, controlled by cache 0. + PSRAM on PS bus starting from 0x28000000, controlled by cache 1. + */ + CACHE64_Init(CACHE64_POLSEL1, &cacheCfg); + CACHE64_EnableWriteBuffer(CACHE64_CTRL1, true); + CACHE64_EnableCache(CACHE64_CTRL1); +#endif + + return status; +} + +void BOARD_InitSleepPinConfig(void) +{ + int32_t i; + + /* Set all non-AON pins output low level in sleep mode. */ + for (i = 0; i < 22; i++) + { + IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow); + } + for (i = 28; i < 64; i++) + { + IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow); + } + + /* Set RF_CNTL 0-3 output low level in sleep mode. */ + for (i = 0; i < 4; i++) + { + IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow); + } +} + +void BOARD_DeinitFlash(FLEXSPI_Type * base) +{ + /* Enable FLEXSPI clock again */ + CLKCTL0->PSCCTL0_SET = CLKCTL0_PSCCTL0_SET_FLEXSPI0_MASK; + + /* Enable FLEXSPI module */ + base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; + + /* Wait until FLEXSPI is not busy */ + while (!((base->STS0 & FLEXSPI_STS0_ARBIDLE_MASK) && (base->STS0 & FLEXSPI_STS0_SEQIDLE_MASK))) + { + } + /* Disable module during the reset procedure */ + base->MCR0 |= FLEXSPI_MCR0_MDIS_MASK; +} + +void BOARD_InitFlash(FLEXSPI_Type * base) +{ + uint32_t status; + uint32_t lastStatus; + uint32_t retry; + + /* Loopback from DQS pad can maximize RD board flash speed. */ + if ((base->MCR0 & FLEXSPI_MCR0_RXCLKSRC_MASK) != FLEXSPI_MCR0_RXCLKSRC(1)) + { + base->MCR0 = (base->MCR0 & ~FLEXSPI_MCR0_RXCLKSRC_MASK) | FLEXSPI_MCR0_RXCLKSRC(1); + } + /* If serial root clock is >= 100 MHz, DLLEN set to 1, OVRDEN set to 0, then SLVDLYTARGET setting of 0x0 is + * recommended. */ + base->DLLCR[0] = 0x1U; + + /* Enable FLEXSPI module */ + base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK; + + base->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK; + while (base->MCR0 & FLEXSPI_MCR0_SWRESET_MASK) + { + } + + /* Need to wait DLL locked if DLL enabled */ + if (0U != (base->DLLCR[0] & FLEXSPI_DLLCR_DLLEN_MASK)) + { + lastStatus = base->STS2; + retry = BOARD_FLEXSPI_DLL_LOCK_RETRY; + /* Wait slave delay line locked and slave reference delay line locked. */ + do + { + status = base->STS2; + if ((status & (FLEXSPI_STS2_AREFLOCK_MASK | FLEXSPI_STS2_ASLVLOCK_MASK)) == + (FLEXSPI_STS2_AREFLOCK_MASK | FLEXSPI_STS2_ASLVLOCK_MASK)) + { + /* Locked */ + retry = 100; + break; + } + else if (status == lastStatus) + { + /* Same delay cell number in calibration */ + retry--; + } + else + { + retry = BOARD_FLEXSPI_DLL_LOCK_RETRY; + lastStatus = status; + } + } while (retry > 0); + /* According to ERR011377, need to delay at least 100 NOPs to ensure the DLL is locked. */ + for (; retry > 0U; retry--) + { + __NOP(); + } + } +} + +/* BOARD_SetFlexspiClock run in RAM used to configure FlexSPI clock source and divider when XIP. */ +void BOARD_SetFlexspiClock(FLEXSPI_Type * base, uint32_t src, uint32_t divider) +{ + if ((CLKCTL0->FLEXSPIFCLKSEL != CLKCTL0_FLEXSPIFCLKSEL_SEL(src)) || + ((CLKCTL0->FLEXSPIFCLKDIV & CLKCTL0_FLEXSPIFCLKDIV_DIV_MASK) != (divider - 1))) + { + /* Always deinit FLEXSPI and init FLEXSPI for the flash to make sure the flash works correctly after the + FLEXSPI root clock changed as the default FLEXSPI configuration may does not work for the new root clock + frequency. */ + BOARD_DeinitFlash(base); + + /* Disable clock before changing clock source */ + CLKCTL0->PSCCTL0_CLR = CLKCTL0_PSCCTL0_CLR_FLEXSPI0_MASK; + /* Update flexspi clock. */ + CLKCTL0->FLEXSPIFCLKSEL = CLKCTL0_FLEXSPIFCLKSEL_SEL(src); + CLKCTL0->FLEXSPIFCLKDIV |= CLKCTL0_FLEXSPIFCLKDIV_RESET_MASK; /* Reset the divider counter */ + CLKCTL0->FLEXSPIFCLKDIV = CLKCTL0_FLEXSPIFCLKDIV_DIV(divider - 1); + while ((CLKCTL0->FLEXSPIFCLKDIV) & CLKCTL0_FLEXSPIFCLKDIV_REQFLAG_MASK) + { + } + /* Enable FLEXSPI clock again */ + CLKCTL0->PSCCTL0_SET = CLKCTL0_PSCCTL0_SET_FLEXSPI0_MASK; + + BOARD_InitFlash(base); + } +} + +/* This function is used to change FlexSPI clock to a stable source before clock sources(Such as PLL and Main clock) + * updating in case XIP(execute code on FLEXSPI memory.) */ +void BOARD_FlexspiClockSafeConfig(void) +{ + /* Move FLEXSPI clock source to T3 256m / 2 to avoid instruction/data fetch issue in XIP when + * updating PLL and main clock. + */ + BOARD_SetFlexspiClock(FLEXSPI, 6U, 2U); +} + +void BOARD_CLIAttachClk(void) +{ + /* attach FRG3 clock to FLEXCOMM3 (debug console) */ + CLOCK_SetFRGClock(BOARD_CLI_FRG_CLK); + CLOCK_AttachClk(BOARD_CLI_CLK_ATTACH); +} diff --git a/examples/platform/nxp/rt/rw61x/board/board.h b/examples/platform/nxp/rt/rw61x/board/board.h new file mode 100644 index 00000000000000..d24ffc3c347dbe --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/board.h @@ -0,0 +1,173 @@ +/* + * Copyright 2021-2023 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +#include "clock_config.h" +#include "fsl_common.h" +#include "fsl_gpio.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +/*! @brief The board name */ +#define BOARD_NAME "RD-RW61X-BGA" + +#ifndef DEBUG_CONSOLE_UART_INDEX +#define DEBUG_CONSOLE_UART_INDEX 3 +#endif + +/*! @brief Macro to judge XIP */ +#define BOARD_IS_XIP() \ + ((((uint32_t) BOARD_InitDebugConsole >= 0x08000000U) && ((uint32_t) BOARD_InitDebugConsole < 0x10000000U)) || \ + (((uint32_t) BOARD_InitDebugConsole >= 0x18000000U) && ((uint32_t) BOARD_InitDebugConsole < 0x20000000U))) + +/*! @brief The UART to use for debug messages. */ +#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart +#if DEBUG_CONSOLE_UART_INDEX == 0 +#define BOARD_DEBUG_UART_BASEADDR (uint32_t) FLEXCOMM0 +#define BOARD_DEBUG_UART_INSTANCE 0U +#define BOARD_DEBUG_UART USART0 +#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFlexCommClkFreq(0) +#define BOARD_DEBUG_UART_FRG_CLK \ + (&(const clock_frg_clk_config_t){ 0, kCLOCK_FrgPllDiv, 255, 0 }) /*!< Select FRG0 mux as frg_pll \ + */ +#define BOARD_DEBUG_UART_CLK_ATTACH kFRG_to_FLEXCOMM0 +#define BOARD_DEBUG_UART_RST kFC0_RST_SHIFT_RSTn +#define BOARD_DEBUG_UART_CLKSRC kCLOCK_Flexcomm0 +#define BOARD_UART_IRQ_HANDLER FLEXCOMM0_IRQHandler +#define BOARD_UART_IRQ FLEXCOMM0_IRQn +#elif DEBUG_CONSOLE_UART_INDEX == 3 +#define BOARD_DEBUG_UART_BASEADDR (uint32_t) FLEXCOMM3 +#define BOARD_DEBUG_UART_INSTANCE 3U +#define BOARD_DEBUG_UART USART3 +#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFlexCommClkFreq(3) +#define BOARD_DEBUG_UART_FRG_CLK \ + (&(const clock_frg_clk_config_t){ 3, kCLOCK_FrgPllDiv, 255, 0 }) /*!< Select FRG3 mux as frg_pll \ + */ +#define BOARD_DEBUG_UART_CLK_ATTACH kFRG_to_FLEXCOMM3 +#define BOARD_DEBUG_UART_RST kFC3_RST_SHIFT_RSTn +#define BOARD_DEBUG_UART_CLKSRC kCLOCK_Flexcomm3 +#define BOARD_UART_IRQ_HANDLER FLEXCOMM3_IRQHandler +#define BOARD_UART_IRQ FLEXCOMM3_IRQn +#else +#error "UART not supported" +#endif + +#ifndef BOARD_DEBUG_UART_BAUDRATE +#define BOARD_DEBUG_UART_BAUDRATE 115200 +#endif /* BOARD_DEBUG_UART_BAUDRATE */ + +#define BOARD_FLEXSPI_PSRAM FLEXSPI +#ifndef BOARD_ENABLE_PSRAM_CACHE +#define BOARD_ENABLE_PSRAM_CACHE 1 +#endif + +/* Board I2C for codec */ +#define BOARD_CODEC_I2C_BASEADDR I2C2 +#define BOARD_CODEC_I2C_CLOCK_FREQ CLOCK_GetFlexCommClkFreq(2U) +#define BOARD_CODEC_I2C_INSTANCE 2 +#define BOARD_CODEC_I2C_SDA_PORT 0 +#define BOARD_CODEC_I2C_SCL_PORT 0 +#define BOARD_CODEC_I2C_SDA_PIN 16 +#define BOARD_CODEC_I2C_SCL_PIN 17 + +/* Board led color mapping */ +#define LOGIC_LED_ON 1U +#define LOGIC_LED_OFF 0U + +/* A fake led on GPIO header */ +#ifndef BOARD_LED_BLUE_GPIO +#define BOARD_LED_BLUE_GPIO GPIO +#endif +#define BOARD_LED_BLUE_GPIO_PORT 0U +#ifndef BOARD_LED_BLUE_GPIO_PIN +#define BOARD_LED_BLUE_GPIO_PIN 2U +#endif + +#define LED_BLUE_INIT(output) \ + GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, BOARD_LED_BLUE_GPIO_PIN, \ + &(gpio_pin_config_t){ kGPIO_DigitalOutput, (output) }) /*!< Enable target LED_BLUE */ +#define LED_BLUE_ON() \ + GPIO_PortSet(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn on target LED_BLUE */ +#define LED_BLUE_OFF() \ + GPIO_PortClear(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Turn off target LED_BLUE */ +#define LED_BLUE_TOGGLE() \ + GPIO_PortToggle(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PORT, 1U << BOARD_LED_BLUE_GPIO_PIN) /*!< Toggle on target LED_BLUE \ + */ + +/* Board SW PIN */ +#ifndef BOARD_SW1_GPIO +#define BOARD_SW1_GPIO GPIO +#endif +#define BOARD_SW1_GPIO_PORT 0U +#ifndef BOARD_SW1_GPIO_PIN +#define BOARD_SW1_GPIO_PIN 13U +#endif + +#ifndef BOARD_SW2_GPIO +#define BOARD_SW2_GPIO GPIO +#endif +#define BOARD_SW2_GPIO_PORT 0U +#ifndef BOARD_SW2_GPIO_PIN +#define BOARD_SW2_GPIO_PIN 14U +#endif + +#ifndef BOARD_SW3_GPIO +#define BOARD_SW3_GPIO GPIO +#endif +#define BOARD_SW3_GPIO_PORT 0U +#ifndef BOARD_SW3_GPIO_PIN +#define BOARD_SW3_GPIO_PIN 24U +#endif + +#ifndef BOARD_SW4_GPIO +#define BOARD_SW4_GPIO GPIO +#endif +#define BOARD_SW4_GPIO_PORT 0U +#ifndef BOARD_SW4_GPIO_PIN +#define BOARD_SW4_GPIO_PIN 25U +#endif + +#define BOARD_ENET0_PHY_ADDRESS (0x02U) + +/*! @brief The USIM SMARTCARD PHY configuration. */ +#define BOARD_SMARTCARD_MODULE (USIM) /*!< SMARTCARD communicational module instance */ +#define BOARD_SMARTCARD_MODULE_IRQ (USIM_IRQn) /*!< SMARTCARD communicational module IRQ handler */ +#define BOARD_SMARTCARD_CLOCK_MODULE_CLK_FREQ (CLOCK_GetUsimClkFreq()) +#define BOARD_SMARTCARD_CLOCK_VALUE (4000000U) /*!< SMARTCARD clock frequency (4Mhz) */ +#define BOARD_SMARTCARD_IRQ_PORT (0) +#define BOARD_SMARTCARD_IRQ_PIN (19) +#define BOARD_SMARTCARD_TS_TIMER_IRQ (CTIMER0_IRQn) + +/* CLI clock config */ +#define BOARD_CLI_FRG_CLK (&(const clock_frg_clk_config_t){ 3, kCLOCK_FrgPllDiv, 255, 0 }) /*!< Select FRG3 mux as frg_pll */ +#define BOARD_CLI_CLK_ATTACH kFRG_to_FLEXCOMM3 + +#if defined(__cplusplus) +extern "C" { +#endif /* __cplusplus */ + +/******************************************************************************* + * API + ******************************************************************************/ + +void BOARD_InitDebugConsole(void); +status_t BOARD_InitPsRam(void); +void BOARD_InitSleepPinConfig(void); +void BOARD_FlexspiClockSafeConfig(void); +void BOARD_CLIAttachClk(void); +AT_QUICKACCESS_SECTION_CODE(void BOARD_SetFlexspiClock(FLEXSPI_Type * base, uint32_t src, uint32_t divider)); +AT_QUICKACCESS_SECTION_CODE(void BOARD_DeinitFlash(FLEXSPI_Type * base)); +AT_QUICKACCESS_SECTION_CODE(void BOARD_InitFlash(FLEXSPI_Type * base)); + +#if defined(__cplusplus) +} +#endif /* __cplusplus */ + +#endif /* _BOARD_H_ */ diff --git a/examples/platform/nxp/rt/rw61x/board/clock_config.c b/examples/platform/nxp/rt/rw61x/board/clock_config.c new file mode 100644 index 00000000000000..5713fa2a9eeb03 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/clock_config.c @@ -0,0 +1,254 @@ +/* + * Copyright 2021 NXP + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "clock_config.h" +#include "board.h" +#include "fsl_clock.h" +#include "fsl_power.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ +const clock_avpll_config_t g_avpllConfig_BOARD_BootClockRUN = { .ch1Freq = kCLOCK_AvPllChFreq12p288m, + .ch2Freq = kCLOCK_AvPllChFreq64m, + .enableCali = true }; + +/*FUNCTION********************************************************************** + * + * Function Name : BOARD_FlexspiClockSafeConfig + * Description : FLEXSPI clock source safe configuration weak function. + * Called before clock source(Such as PLL, Main clock) configuration. + * Note : Users need override this function to change FLEXSPI clock source to stable source when executing + * code on FLEXSPI memory(XIP). If XIP, the function should runs in RAM and move the FLEXSPI clock + *source to an stable clock to avoid instruction/data fetch issue during clock updating. + *END**************************************************************************/ +__attribute__((weak)) void BOARD_FlexspiClockSafeConfig(void) {} + +/*FUNCTION********************************************************************** + * + * Function Name : BOARD_SetFlexspiClock + * Description : This function should be overridden if executing code on FLEXSPI memory(XIP). + * To Change FLEXSPI clock, should move to run from RAM and then configure FLEXSPI clock source. + * After the clock is changed and stable, move back to run on FLEXSPI. + * Param base : FLEXSPI peripheral base address. + * Param src : FLEXSPI clock source. + * Param divider : FLEXSPI clock divider. + *END**************************************************************************/ +__attribute__((weak)) void BOARD_SetFlexspiClock(FLEXSPI_Type * base, uint32_t src, uint32_t divider) +{ + CLKCTL0->FLEXSPIFCLKSEL = CLKCTL0_FLEXSPIFCLKSEL_SEL(src); + CLKCTL0->FLEXSPIFCLKDIV |= CLKCTL0_FLEXSPIFCLKDIV_RESET_MASK; /* Reset the divider counter */ + CLKCTL0->FLEXSPIFCLKDIV = CLKCTL0_FLEXSPIFCLKDIV_DIV(divider - 1); + while ((CLKCTL0->FLEXSPIFCLKDIV) & CLKCTL0_FLEXSPIFCLKDIV_REQFLAG_MASK) + { + } +} + +/******************************************************************************* + ************************ BOARD_InitBootClocks function ************************ + ******************************************************************************/ +void BOARD_InitBootClocks(void) +{ + BOARD_BootClockRUN(); +} + +/******************************************************************************* + ********************** Configuration BOARD_BootClockRUN *********************** + ******************************************************************************/ +/******************************************************************************* + * Variables for BOARD_BootClockRUN configuration + ******************************************************************************/ + +/******************************************************************************* + * Code for BOARD_BootClockRUN configuration + ******************************************************************************/ +void BOARD_BootClockRUN(void) +{ + if ((PMU->CAU_SLP_CTRL & PMU_CAU_SLP_CTRL_SOC_SLP_RDY_MASK) == 0U) + { + /* LPOSC not enabled, enable it */ + CLOCK_EnableClock(kCLOCK_RefClkCauSlp); + } + if ((SYSCTL2->SOURCE_CLK_GATE & SYSCTL2_SOURCE_CLK_GATE_REFCLK_SYS_CG_MASK) != 0U) + { + /* REFCLK_SYS not enabled, enable it */ + CLOCK_EnableClock(kCLOCK_RefClkSys); + } + + /* Initialize T3 clocks and t3pll_mci_48_60m_irc configured to 48.3MHz */ + CLOCK_InitT3RefClk(kCLOCK_T3MciIrc48m); + /* Enable FFRO */ + CLOCK_EnableClock(kCLOCK_T3PllMciIrcClk); + /* Enable T3 256M clock and SFRO */ + CLOCK_EnableClock(kCLOCK_T3PllMci256mClk); + + if (BOARD_IS_XIP()) + { + /* Call function BOARD_FlexspiClockSafeConfig() to move FlexSPI clock to a stable clock source to avoid + instruction/data fetch issue when updating PLL and Main clock if XIP(execute code on FLEXSPI memory). */ + BOARD_FlexspiClockSafeConfig(); + } + + /* First let M33 run on SOSC */ + CLOCK_AttachClk(kSYSOSC_to_MAIN_CLK); + CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1); + + /* tcpu_mci_clk configured to 260MHz, tcpu_mci_flexspi_clk 312MHz. */ + CLOCK_InitTcpuRefClk(3120000000UL, kCLOCK_TcpuFlexspiDiv10); + /* Enable tcpu_mci_clk 260MHz. Keep tcpu_mci_flexspi_clk gated. */ + CLOCK_EnableClock(kCLOCK_TcpuMciClk); + + /* tddr_mci_flexspi_clk 320MHz */ + CLOCK_InitTddrRefClk(kCLOCK_TddrFlexspiDiv10); + CLOCK_EnableClock(kCLOCK_TddrMciFlexspiClk); /* 320MHz */ + + /* Enable AUX0 PLL to 260MHz. */ + CLOCK_SetClkDiv(kCLOCK_DivAux0PllClk, 1U); + + /* Init AVPLL and enable both channels. */ + CLOCK_InitAvPll(&g_avpllConfig_BOARD_BootClockRUN); + CLOCK_SetClkDiv(kCLOCK_DivAudioPllClk, 1U); + + /* Configure MainPll to 260MHz, then let CM33 run on Main PLL. */ + CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1U); + CLOCK_SetClkDiv(kCLOCK_DivMainPllClk, 1U); + CLOCK_AttachClk(kMAIN_PLL_to_MAIN_CLK); + + /* Set SYSTICKFCLKDIV divider to value 1 */ + CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 1U); + CLOCK_AttachClk(kSYSTICK_DIV_to_SYSTICK_CLK); + + if (BOARD_IS_XIP()) + { + /* Call function BOARD_SetFlexspiClock() to set clock source to aux0_pll_clk. */ + BOARD_SetFlexspiClock(FLEXSPI, 2U, 2U); + } + + /* Set PLL FRG clock to 20MHz. */ + CLOCK_SetClkDiv(kCLOCK_DivPllFrgClk, 13U); + + /* Measure main_clk on CLKOUT. Set CLKOUTFCLKDIV divider to value 100 */ + CLOCK_AttachClk(kMAIN_CLK_to_CLKOUT); + SOCCTRL->TST_TSTBUS_CTRL2 = + (SOCCTRL->TST_TSTBUS_CTRL2 & ~(SOCCIU_TST_TSTBUS_CTRL2_CLK_OUT_PAGE_SEL_MASK | SOCCIU_TST_TSTBUS_CTRL2_CLK_OUT_SEL_MASK)) | + SOCCIU_TST_TSTBUS_CTRL2_CLK_OUT_PAGE_SEL(3) | SOCCIU_TST_TSTBUS_CTRL2_CLK_OUT_SEL(14); + CLOCK_SetClkDiv(kCLOCK_DivClockOut, 100U); + + /* Set SystemCoreClock variable. */ + SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; +} + +/******************************************************************************* + ********************** Configuration BOARD_BootClockLPR *********************** + ******************************************************************************/ +/******************************************************************************* + * Variables for BOARD_BootClockLPR configuration + ******************************************************************************/ + +/******************************************************************************* + * Code for BOARD_BootClockLPR configuration + ******************************************************************************/ +void BOARD_BootClockLPR(void) +{ + CLOCK_DisableClock(kCLOCK_Pkc); + CLOCK_DisableClock(kCLOCK_Els); + CLOCK_DisableClock(kCLOCK_ElsApb); + CLOCK_DisableClock(kCLOCK_Otp); + CLOCK_DisableClock(kCLOCK_Wwdt0); + CLOCK_DisableClock(kCLOCK_Flexcomm0); + CLOCK_DisableClock(kCLOCK_Flexcomm2); + CLOCK_DisableClock(kCLOCK_Flexcomm3); + CLOCK_DisableClock(kCLOCK_Crc); + CLOCK_DisableClock(kCLOCK_Itrc); + + RESET_SetPeripheralReset(kPKC_RST_SHIFT_RSTn); + // RESET_SetPeripheralReset(kELS_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kELS_APB_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kELS_GDET_REF_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kOTP_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kWWDT_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kFC0_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kFC2_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kFC3_RST_SHIFT_RSTn); + RESET_SetPeripheralReset(kCRC_RST_SHIFT_RSTn); + + if ((PMU->CAU_SLP_CTRL & PMU_CAU_SLP_CTRL_SOC_SLP_RDY_MASK) == 0U) + { + /* LPOSC not enabled, enable it */ + CLOCK_EnableClock(kCLOCK_RefClkCauSlp); + } + if ((SYSCTL2->SOURCE_CLK_GATE & SYSCTL2_SOURCE_CLK_GATE_REFCLK_SYS_CG_MASK) != 0U) + { + /* REFCLK_SYS not enabled, enable it */ + CLOCK_EnableClock(kCLOCK_RefClkSys); + } + + if (BOARD_IS_XIP()) + { + /* Initialize T3 clocks and t3pll_mci_48_60m_irc configured to 48.3MHz */ + CLOCK_InitT3RefClk(kCLOCK_T3MciIrc48m); + /* Enable T3 256M clock and SFRO */ + CLOCK_EnableClock(kCLOCK_T3PllMci256mClk); + + /* Call function BOARD_FlexspiClockSafeConfig() to move FlexSPI clock to a stable clock source to avoid + instruction/data fetch issue when updating PLL and Main clock if XIP(execute code on FLEXSPI memory). */ + BOARD_FlexspiClockSafeConfig(); + } + else + { + RESET_ClearPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn); + BOARD_DeinitFlash(FLEXSPI); + CLOCK_AttachClk(kNONE_to_FLEXSPI_CLK); + CLOCK_DisableClock(kCLOCK_Flexspi); + RESET_SetPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn); + } + + /* Deinitialize TDDR clocks */ + CLOCK_DeinitTddrRefClk(); + + /* First let M33 run on SOSC */ + CLOCK_AttachClk(kSYSOSC_to_MAIN_CLK); + CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1); + + /* tcpu_mci_clk configured to 260MHz, tcpu_mci_flexspi_clk 312MHz. */ + CLOCK_InitTcpuRefClk(3120000000UL, kCLOCK_TcpuFlexspiDiv10); + /* Enable tcpu_mci_clk 260MHz. Keep tcpu_mci_flexspi_clk gated. */ + CLOCK_EnableClock(kCLOCK_TcpuMciClk); + + /* Enable AUX0 PLL to 260MHz. */ + CLOCK_SetClkDiv(kCLOCK_DivAux0PllClk, 1U); + + /* Configure MainPll to 260MHz, then let CM33 run on Main PLL. */ + CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1U); + CLOCK_SetClkDiv(kCLOCK_DivMainPllClk, 1U); + CLOCK_AttachClk(kMAIN_PLL_to_MAIN_CLK); + + /* Set SYSTICKFCLKDIV divider to value 1 */ + CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 1U); + CLOCK_AttachClk(kSYSTICK_DIV_to_SYSTICK_CLK); + + if (BOARD_IS_XIP()) + { + /* Call function BOARD_SetFlexspiClock() to set clock source to aux0_pll_clk. */ + BOARD_SetFlexspiClock(FLEXSPI, 2U, 2U); + } + + /* Set PLL FRG clock to 20MHz. */ + CLOCK_SetClkDiv(kCLOCK_DivPllFrgClk, 13U); + + /* Deinitialize T3 clocks */ + CLOCK_DeinitT3RefClk(); + + /* Deinitialize AVPLL clocks */ + CLOCK_DeinitAvPll(); + + /* Set SystemCoreClock variable. */ + SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; +} diff --git a/examples/platform/nxp/rt/rw61x/board/clock_config.h b/examples/platform/nxp/rt/rw61x/board/clock_config.h new file mode 100644 index 00000000000000..e5ecfed533844d --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/clock_config.h @@ -0,0 +1,65 @@ +/* + * Copyright 2021 NXP + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _CLOCK_CONFIG_H_ +#define _CLOCK_CONFIG_H_ + +#include "fsl_common.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + ************************ BOARD_InitBootClocks function ************************ + ******************************************************************************/ + +#if defined(__cplusplus) +extern "C" { +#endif /* __cplusplus*/ + +/*! + * @brief This function executes default configuration of clocks. + * + */ +void BOARD_InitBootClocks(void); + +#if defined(__cplusplus) +} +#endif /* __cplusplus*/ + +/******************************************************************************* + ********************** Configuration BOARD_BootClockRUN *********************** + ******************************************************************************/ +/******************************************************************************* + * Definitions for BOARD_BootClockRUN configuration + ******************************************************************************/ +#define BOARD_BOOTCLOCKRUN_CORE_CLOCK 260000000U /*!< Core clock frequency: 260000000Hz */ + +/******************************************************************************* + * API for BOARD_BootClockRUN configuration + ******************************************************************************/ +#if defined(__cplusplus) +extern "C" { +#endif /* __cplusplus*/ + +/*! + * @brief This function executes configuration of clocks. + * + */ +void BOARD_BootClockRUN(void); + +/*! + * @brief This function executes configuration of clocks for low power run. + * + */ +void BOARD_BootClockLPR(void); + +#if defined(__cplusplus) +} +#endif /* __cplusplus*/ + +#endif /* _CLOCK_CONFIG_H_ */ diff --git a/examples/platform/nxp/rt/rw61x/board/hardware_init.c b/examples/platform/nxp/rt/rw61x/board/hardware_init.c new file mode 100644 index 00000000000000..1d7963d6ddb7e1 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/hardware_init.c @@ -0,0 +1,33 @@ +/* + * Copyright 2020, 2023 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/*${header:start}*/ +#include "board.h" +#include "clock_config.h" +#include "fsl_device_registers.h" +#include "pin_mux.h" +/*${header:end}*/ + +static gpio_pin_config_t pinConfig = { + kGPIO_DigitalOutput, + 0, +}; + +/*${function:start}*/ +void BOARD_InitHardware(void) +{ + BOARD_InitBootPins(); + BOARD_InitBootClocks(); + BOARD_InitDebugConsole(); + + CLOCK_EnableClock(kCLOCK_Flexspi); + RESET_ClearPeripheralReset(kFLEXSPI_RST_SHIFT_RSTn); + + /* Use aux0_pll_clk / 2 */ + BOARD_SetFlexspiClock(FLEXSPI, 2U, 2U); +} +/*${function:end}*/ diff --git a/examples/platform/nxp/rt/rw61x/board/peripherals.c b/examples/platform/nxp/rt/rw61x/board/peripherals.c new file mode 100644 index 00000000000000..5fc55eee46fdc4 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/peripherals.c @@ -0,0 +1,149 @@ +/*********************************************************************************************************************** + * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file + * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. + **********************************************************************************************************************/ + +/* clang-format off */ +/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* +!!GlobalInfo +product: Peripherals v11.0 +processor: MIMXRT1062xxxxA +package_id: MIMXRT1062DVL6A +mcu_data: ksdk2_0 +processor_version: 11.0.1 +board: MIMXRT1060-EVKB +functionalGroups: +- name: BOARD_InitPeripherals + UUID: 96c1cec6-3bd3-47a2-8301-f38e4b0dd25f + called_from_default_init: true + selectedCore: core0 + * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ + +/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* +component: +- type: 'system' +- type_id: 'system' +- global_system_definitions: + - user_definitions: 'extern uint32_t NV_STORAGE_START_ADDRESS_OFFSET[];\nextern uint32_t NV_STORAGE_MAX_SECTORS[];\n\n\n#define LITTLEFS_START_ADDR (uint32_t)(NV_STORAGE_START_ADDRESS_OFFSET)\n' + - user_includes: '\n' + * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ + +/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* +component: +- type: 'uart_cmsis_common' +- type_id: 'uart_cmsis_common_9cb8e302497aa696fdbb5a4fd622c2a8' +- global_USART_CMSIS_common: + - quick_selection: 'default' + * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ + +/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* +component: +- type: 'gpio_adapter_common' +- type_id: 'gpio_adapter_common_57579b9ac814fe26bf95df0a384c36b6' +- global_gpio_adapter_common: + - quick_selection: 'default' + * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ +/* clang-format on */ + +/*********************************************************************************************************************** + * Included files + **********************************************************************************************************************/ +#include "peripherals.h" + +/*********************************************************************************************************************** + * BOARD_InitPeripherals functional group + **********************************************************************************************************************/ +/*********************************************************************************************************************** + * LittleFS initialization code + **********************************************************************************************************************/ +/* clang-format off */ +/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* +instance: +- name: 'LittleFS' +- type: 'littlefs' +- mode: 'general' +- custom_name_enabled: 'false' +- type_id: 'littlefs_7e89bf6c938031bfd17176a3aacf1bc3' +- functional_group: 'BOARD_InitPeripherals' +- config_sets: + - general_config: + - moduleInclude: 'fwk_platform_flash.h' + - lfsConfig: + - enableUserContext: 'true' + - userContext: + - contextVar: '(void*)&LittleFS_ctx' + - contextDef: 'extern struct lfs_mflash_ctx LittleFS_ctx;' + - userCallbacks: + - read: 'lfs_mflash_read' + - prog: 'lfs_mflash_prog' + - erase: 'lfs_mflash_erase' + - sync: 'lfs_mflash_sync' + - lock: 'lfs_mutex_lock' + - unlock: 'lfs_mutex_unlock' + - readSize: '16' + - progSize: '256' + - blockSize: '4096' + - firstBlock: '(uint32_t)(NV_STORAGE_START_ADDRESS_OFFSET)' + - blockCount: '(uint32_t)(NV_STORAGE_MAX_SECTORS)' + - blockCycles: '100' + - cacheSize: '256' + - lookaheadSize: '16' + - enableReadBuff: 'false' + - readBuffer: + - customBuffer: 'false' + - enableProgBuff: 'false' + - progBuffer: + - customBuffer: 'false' + - enableLookaheadBuff: 'false' + - lookaheadBuffer: + - customBuffer: 'false' + - enableOptionalSizes: 'false' + - optionalSizes: + - name_max: '255' + - file_max: '0x7FFFFFFF' + - attr_max: '1022' + - metadata_max: '4096' + - initLFS: 'false' + - initConfig: + - lfsObj: 'LittleFS_system' + - mountLFS: 'disable' + * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ +/* clang-format on */ +/* LittleFS context */ +extern struct lfs_mflash_ctx LittleFS_ctx; +const struct lfs_config LittleFS_config = { .context = (void *) &LittleFS_ctx, + .read = lfs_mflash_read, + .prog = lfs_mflash_prog, + .erase = lfs_mflash_erase, + .sync = lfs_mflash_sync, +#ifdef LFS_THREADSAFE + .lock = lfs_mutex_lock, + .unlock = lfs_mutex_unlock, +#endif + .read_size = LITTLEFS_READ_SIZE, + .prog_size = LITTLEFS_PROG_SIZE, + .block_size = LITTLEFS_BLOCK_SIZE, + .block_count = LITTLEFS_BLOCK_COUNT, + .block_cycles = LITTLEFS_BLOCK_CYCLES, + .cache_size = LITTLEFS_CACHE_SIZE, + .lookahead_size = LITTLEFS_LOOKAHEAD_SIZE }; + +/* Empty initialization function (commented out) +static void LittleFS_init(void) { +} */ + +/*********************************************************************************************************************** + * Initialization functions + **********************************************************************************************************************/ +void BOARD_InitPeripherals(void) +{ + /* Initialize components */ +} + +/*********************************************************************************************************************** + * BOARD_InitBootPeripherals function + **********************************************************************************************************************/ +void BOARD_InitBootPeripherals(void) +{ + BOARD_InitPeripherals(); +} diff --git a/examples/platform/nxp/rt/rw61x/board/peripherals.h b/examples/platform/nxp/rt/rw61x/board/peripherals.h new file mode 100644 index 00000000000000..6c50bc87364ccf --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/peripherals.h @@ -0,0 +1,102 @@ +/*********************************************************************************************************************** + * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file + * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. + **********************************************************************************************************************/ + +#ifndef _PERIPHERALS_H_ +#define _PERIPHERALS_H_ + +#define CHIP_PLAT_NO_NVM 0 +#define CHIP_PLAT_NVM_FWK 1 +#define CHIP_PLAT_LITTLEFS 2 +#define CHIP_PLAT_KEY_STORAGE 3 + +#ifndef CHIP_PLAT_NVM_SUPPORT +#define CHIP_PLAT_NVM_SUPPORT CHIP_PLAT_NO_NVM +#endif + +/*********************************************************************************************************************** + * Included files + **********************************************************************************************************************/ +#include "fsl_common.h" + +#if (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_NVM_FWK || CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_LITTLEFS) +#include "fwk_platform_flash.h" +#elif (CHIP_PLAT_NVM_SUPPORT == CHIP_PLAT_KEY_STORAGE) +#include "fwk_lfs_mflash.h" +#endif + +#include "lfs.h" + +#if defined(__cplusplus) +extern "C" { +#endif /* __cplusplus */ + +/*********************************************************************************************************************** + * User definitions + **********************************************************************************************************************/ +extern uint32_t NV_STORAGE_START_ADDRESS_OFFSET[]; +extern uint32_t NV_STORAGE_MAX_SECTORS[]; + +#define LITTLEFS_START_ADDR (uint32_t)(NV_STORAGE_START_ADDRESS_OFFSET) + +/*********************************************************************************************************************** + * Definitions + **********************************************************************************************************************/ +/* Definitions for BOARD_InitPeripherals functional group */ +/* Maximum block read size definition */ +#define LITTLEFS_READ_SIZE 16 +/* Maximum block program size definition */ +#define LITTLEFS_PROG_SIZE 256 +/* Erasable block size definition */ +#define LITTLEFS_BLOCK_SIZE 4096 +/* Block count definition */ +#define LITTLEFS_BLOCK_COUNT (uint32_t)(NV_STORAGE_MAX_SECTORS) +/* Block cycles definition */ +#define LITTLEFS_BLOCK_CYCLES 100 +/* Minimum block cache size definition */ +#define LITTLEFS_CACHE_SIZE 256 +/* Minimum lookahead buffer size definition */ +#define LITTLEFS_LOOKAHEAD_SIZE 16 +/* Block starting address definition */ +#define LITTLEFS_START_ADDR (uint32_t)(NV_STORAGE_START_ADDRESS_OFFSET) + +/*********************************************************************************************************************** + * Global variables + **********************************************************************************************************************/ +/* LittleFS configuration */ +extern const struct lfs_config LittleFS_config; + +/*********************************************************************************************************************** + * Callback functions + **********************************************************************************************************************/ +/* LittleFS read a block region callback*/ +extern int lfs_mflash_read(const struct lfs_config *, lfs_block_t, lfs_off_t, void *, lfs_size_t); +/* LittleFS program a block region callback*/ +extern int lfs_mflash_prog(const struct lfs_config *, lfs_block_t, lfs_off_t, const void *, lfs_size_t); +/* LittleFS erase a block callback*/ +extern int lfs_mflash_erase(const struct lfs_config *, lfs_block_t); +/* LittleFS state sync callback*/ +extern int lfs_mflash_sync(const struct lfs_config *); +/* LittleFS state lock callback*/ +extern int lfs_mutex_lock(const struct lfs_config *); +/* LittleFS state unlock callback*/ +extern int lfs_mutex_unlock(const struct lfs_config *); + +/*********************************************************************************************************************** + * Initialization functions + **********************************************************************************************************************/ + +void BOARD_InitPeripherals(void); + +/*********************************************************************************************************************** + * BOARD_InitBootPeripherals function + **********************************************************************************************************************/ + +void BOARD_InitBootPeripherals(void); + +#if defined(__cplusplus) +} +#endif + +#endif /* _PERIPHERALS_H_ */ diff --git a/examples/platform/nxp/rt/rw61x/board/pin_mux.c b/examples/platform/nxp/rt/rw61x/board/pin_mux.c new file mode 100644 index 00000000000000..8ab48ff62e8d0f --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/pin_mux.c @@ -0,0 +1,39 @@ +/* + * Copyright 2021, 2023 NXP. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "pin_mux.h" +#include "fsl_common.h" +#include "fsl_io_mux.h" + +/* FUNCTION ************************************************************************************************************ + * + * Function Name : BOARD_InitBootPins + * Description : Calls initialization functions. + * + * END ****************************************************************************************************************/ +void BOARD_InitBootPins(void) +{ + BOARD_InitPins(); +} + +/* FUNCTION ************************************************************************************************************ + * + * Function Name : BOARD_InitPins + * Description : Configures pin routing and optionally pin electrical features. + * + * END ****************************************************************************************************************/ +void BOARD_InitPins(void) +{ /*!< Function assigned for the core: Cortex-M33[cm33] */ + IO_MUX_SetPinMux(IO_MUX_FC3_USART_DATA); + IO_MUX_SetPinMux(IO_MUX_GPIO25); + /* FLEXCOMM0 TX for logging*/ + IO_MUX_SetPinMux(IO_MUX_FC0_USART_DATA); +} + +/*********************************************************************************************************************** + * EOF + **********************************************************************************************************************/ diff --git a/examples/platform/nxp/rt/rw61x/board/pin_mux.h b/examples/platform/nxp/rt/rw61x/board/pin_mux.h new file mode 100644 index 00000000000000..d01bc202b03184 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/board/pin_mux.h @@ -0,0 +1,51 @@ +/* + * Copyright 2021 NXP. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _PIN_MUX_H_ +#define _PIN_MUX_H_ + +/*********************************************************************************************************************** + * Definitions + **********************************************************************************************************************/ + +/*! + * @addtogroup pin_mux + * @{ + */ + +/*********************************************************************************************************************** + * API + **********************************************************************************************************************/ + +#if defined(__cplusplus) +extern "C" { +#endif + +/*! + * @brief Calls initialization functions. + * + */ +void BOARD_InitBootPins(void); + +/*! + * @brief Configures pin routing and optionally pin electrical features. + * + */ +void BOARD_InitPins(void); /*!< Function assigned for the core: Cortex-M4[cm4] */ + +#if defined(__cplusplus) +} +#endif + +/*! + * @} + */ +#endif /* _PIN_MUX_H_ */ + +/*********************************************************************************************************************** + * EOF + **********************************************************************************************************************/ diff --git a/examples/platform/nxp/rt/rw61x/doc/images/mcu-set.PNG b/examples/platform/nxp/rt/rw61x/doc/images/mcu-set.PNG new file mode 100644 index 00000000000000..1904593a66a8a4 Binary files /dev/null and b/examples/platform/nxp/rt/rw61x/doc/images/mcu-set.PNG differ diff --git a/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_demo.PNG b/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_demo.PNG new file mode 100644 index 00000000000000..c22b1c772b7c41 Binary files /dev/null and b/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_demo.PNG differ diff --git a/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_monolithic_app.PNG b/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_monolithic_app.PNG new file mode 100644 index 00000000000000..8c9953c4a2c762 Binary files /dev/null and b/examples/platform/nxp/rt/rw61x/doc/images/mcuboot_monolithic_app.PNG differ diff --git a/examples/platform/nxp/rt/rw61x/doc/images/mcux-sdk-download.PNG b/examples/platform/nxp/rt/rw61x/doc/images/mcux-sdk-download.PNG new file mode 100644 index 00000000000000..c6afd18b6beb0b Binary files /dev/null and b/examples/platform/nxp/rt/rw61x/doc/images/mcux-sdk-download.PNG differ diff --git a/examples/platform/nxp/rt/rw61x/doc/images/toolchain.JPG b/examples/platform/nxp/rt/rw61x/doc/images/toolchain.JPG new file mode 100644 index 00000000000000..068ebfb35e1efa Binary files /dev/null and b/examples/platform/nxp/rt/rw61x/doc/images/toolchain.JPG differ diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index c9a7670623e684..27b677432b30d5 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -265,14 +265,12 @@ static sl_status_t wfx_rsi_init(void) return status; } #endif - status = sl_wifi_get_mac_address(SL_WIFI_CLIENT_INTERFACE, (sl_mac_address_t *) &wfx_rsi.sta_mac.octet[0]); if (status != SL_STATUS_OK) { SILABS_LOG("sl_wifi_get_mac_address failed: %x", status); return status; } - wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup); wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY; osSemaphoreRelease(sl_rs_ble_init_sem); @@ -400,14 +398,19 @@ static void wfx_rsi_save_ap_info() // translation return; } wfx_rsi.dev_state |= WFX_RSI_ST_SCANSTARTED; - sl_status_t status = SL_STATUS_OK; + sl_status_t status = SL_STATUS_OK; +#ifndef EXP_BOARD // TODO: this changes will be reverted back after the SDK team fix the scan API sl_wifi_scan_configuration_t wifi_scan_configuration = { 0 }; wifi_scan_configuration = default_wifi_scan_configuration; +#endif sl_wifi_ssid_t ssid_arg; ssid_arg.length = strlen(wfx_rsi.sec.ssid); memcpy(ssid_arg.value, (int8_t *) &wfx_rsi.sec.ssid[0], ssid_arg.length); sl_wifi_set_scan_callback(scan_callback_handler, NULL); +#ifndef EXP_BOARD + // TODO: this changes will be reverted back after the SDK team fix the scan API status = sl_wifi_start_scan(SL_WIFI_CLIENT_2_4GHZ_INTERFACE, &ssid_arg, &wifi_scan_configuration); +#endif if (SL_STATUS_IN_PROGRESS == status) { const uint32_t start = osKernelGetTickCount(); @@ -510,6 +513,7 @@ static sl_status_t wfx_rsi_do_join(void) { while (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN) { + SILABS_LOG("%s: Wifi connect failed with status: %x", __func__, status); SILABS_LOG("%s: failed. retry: %d", __func__, wfx_rsi.join_retries); wfx_retry_interval_handler(is_wifi_disconnection_event, wfx_rsi.join_retries++); if (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN) diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 41899c8a1f9c73..0731410dfe07da 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -351,9 +351,11 @@ void AppTaskCommon::ButtonEventHandler(ButtonId_t btnId, bool btnPressed) switch (btnId) { +#if APP_USE_EXAMPLE_START_BUTTON case kButtonId_ExampleAction: ExampleActionButtonEventHandler(); break; +#endif case kButtonId_FactoryReset: FactoryResetButtonEventHandler(); break; diff --git a/examples/pump-app/cc13x2x7_26x2x7/README.md b/examples/pump-app/cc13x2x7_26x2x7/README.md index d3d53d87e7634b..6bfb8feee4665f 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/README.md +++ b/examples/pump-app/cc13x2x7_26x2x7/README.md @@ -58,9 +58,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -87,7 +87,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -95,7 +95,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/pump-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/pump-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -104,7 +104,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/pump-app/cc13x4_26x4/README.md b/examples/pump-app/cc13x4_26x4/README.md index 08385526ae14d9..7ad0521fef77de 100644 --- a/examples/pump-app/cc13x4_26x4/README.md +++ b/examples/pump-app/cc13x4_26x4/README.md @@ -58,9 +58,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -87,7 +87,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -95,7 +95,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/pump-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/pump-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -104,7 +104,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/pump-app/nrfconnect/main/include/AppTask.h b/examples/pump-app/nrfconnect/main/include/AppTask.h index e36bedd01b0efb..fb2fe2c855cb1a 100644 --- a/examples/pump-app/nrfconnect/main/include/AppTask.h +++ b/examples/pump-app/nrfconnect/main/include/AppTask.h @@ -36,13 +36,10 @@ #endif struct k_timer; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance(void) { static AppTask sAppTask; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 1773f74127a82f..97ece6ceda452c 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,33 +43,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -88,23 +88,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -187,7 +187,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -225,7 +225,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -239,13 +239,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -253,7 +253,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -311,7 +311,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -335,7 +335,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -396,20 +396,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -470,13 +470,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -484,7 +484,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -545,7 +545,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -553,7 +553,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -609,7 +609,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -625,7 +625,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -634,13 +634,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -742,7 +750,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -752,7 +760,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -766,7 +774,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -774,14 +782,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -841,19 +849,19 @@ server cluster GeneralDiagnostics = 51 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -863,7 +871,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -958,21 +966,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -985,7 +997,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -999,12 +1011,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1046,7 +1058,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1054,14 +1066,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1084,12 +1096,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1100,7 +1112,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1115,12 +1127,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1187,7 +1199,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -1196,14 +1208,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1213,9 +1225,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -1309,10 +1321,10 @@ server cluster PumpConfigurationAndControl = 512 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1323,7 +1335,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -1360,18 +1372,18 @@ server cluster FlowMeasurement = 1028 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 3c85e060c2a95b..6e21cc9d3de2cf 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -2160,7 +2160,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4590,5 +4590,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 39acb76a9d6e3c..8112f63eebb16f 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,33 +43,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -88,23 +88,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -187,7 +187,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -225,7 +225,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -239,13 +239,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -253,7 +253,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -311,7 +311,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -335,7 +335,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -396,20 +396,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -470,13 +470,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -484,7 +484,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -545,7 +545,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -553,7 +553,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -609,7 +609,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -625,7 +625,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -634,13 +634,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -742,7 +750,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -752,7 +760,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -766,7 +774,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -774,14 +782,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -841,19 +849,19 @@ server cluster GeneralDiagnostics = 51 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -863,7 +871,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -958,21 +966,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -985,7 +997,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -999,12 +1011,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1046,7 +1058,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1054,14 +1066,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1084,12 +1096,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1100,7 +1112,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1115,12 +1127,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1187,7 +1199,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -1196,14 +1208,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1213,9 +1225,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -1309,10 +1321,10 @@ server cluster PumpConfigurationAndControl = 512 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1323,7 +1335,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -1360,18 +1372,18 @@ server cluster FlowMeasurement = 1028 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index c41037144521db..30e326a3bf068c 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -2160,7 +2160,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4590,5 +4590,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 39acb76a9d6e3c..8112f63eebb16f 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,33 +43,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -88,23 +88,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -187,7 +187,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -225,7 +225,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -239,13 +239,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -253,7 +253,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -311,7 +311,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -335,7 +335,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -396,20 +396,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -470,13 +470,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -484,7 +484,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -545,7 +545,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -553,7 +553,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -609,7 +609,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -625,7 +625,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -634,13 +634,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -742,7 +750,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -752,7 +760,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -766,7 +774,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -774,14 +782,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -841,19 +849,19 @@ server cluster GeneralDiagnostics = 51 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -863,7 +871,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -958,21 +966,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -985,7 +997,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -999,12 +1011,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1046,7 +1058,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1054,14 +1066,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1084,12 +1096,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1100,7 +1112,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1115,12 +1127,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1187,7 +1199,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ server cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -1196,14 +1208,14 @@ server cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1213,9 +1225,9 @@ server cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -1309,10 +1321,10 @@ server cluster PumpConfigurationAndControl = 512 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1323,7 +1335,7 @@ server cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ server cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } @@ -1360,18 +1372,18 @@ server cluster FlowMeasurement = 1028 { /** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ client cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { + enum OccupancySensorTypeEnum : enum8 { kPIR = 0; kUltrasonic = 1; kPIRAndUltrasonic = 2; kPhysicalContact = 3; } - bitmap OccupancyBitmap : BITMAP8 { + bitmap OccupancyBitmap : bitmap8 { kOccupied = 0x1; } - bitmap OccupancySensorTypeBitmap : BITMAP8 { + bitmap OccupancySensorTypeBitmap : bitmap8 { kPIR = 0x1; kUltrasonic = 0x2; kPhysicalContact = 0x4; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index c41037144521db..30e326a3bf068c 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -2160,7 +2160,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4590,5 +4590,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/pump-app/silabs/include/CHIPProjectConfig.h b/examples/pump-app/silabs/include/CHIPProjectConfig.h index 00df921596102a..fc137c8d61d7d9 100644 --- a/examples/pump-app/silabs/include/CHIPProjectConfig.h +++ b/examples/pump-app/silabs/include/CHIPProjectConfig.h @@ -100,5 +100,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp index 2dab9268a9035c..f1608b40f3325c 100644 --- a/examples/pump-app/silabs/src/AppTask.cpp +++ b/examples/pump-app/silabs/src/AppTask.cpp @@ -26,7 +26,6 @@ #include "LEDWidget.h" #include -#include #include #include #include diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index a5a656c68adeea..4d67799bfd28f5 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -25,7 +25,7 @@ reference for creating your own pump application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/README.md b/examples/pump-controller-app/cc13x2x7_26x2x7/README.md index 90df4c9c7bd521..f20a3151e912a2 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/README.md +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/README.md @@ -59,9 +59,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -88,7 +88,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -96,7 +96,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/pump-controller-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/pump-controller-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -105,7 +105,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X2_26X2_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/pump-controller-app/cc13x4_26x4/README.md b/examples/pump-controller-app/cc13x4_26x4/README.md index dc917f93c5544e..15894f7d596323 100644 --- a/examples/pump-controller-app/cc13x4_26x4/README.md +++ b/examples/pump-controller-app/cc13x4_26x4/README.md @@ -59,9 +59,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -88,7 +88,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -96,7 +96,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/pump-controller-app/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/pump-controller-app/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -105,7 +105,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/pump-controller-app/nrfconnect/main/include/AppTask.h b/examples/pump-controller-app/nrfconnect/main/include/AppTask.h index d0c670785c2a9a..8ca4a69e91c0f0 100644 --- a/examples/pump-controller-app/nrfconnect/main/include/AppTask.h +++ b/examples/pump-controller-app/nrfconnect/main/include/AppTask.h @@ -36,13 +36,10 @@ #endif struct k_timer; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance(void) { static AppTask sAppTask; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index a9651460e67187..fd542a29b72f78 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,33 +43,33 @@ server cluster Identify = 3 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -112,7 +112,7 @@ client cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -150,7 +150,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -164,13 +164,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -178,7 +178,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -236,7 +236,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -260,7 +260,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -321,20 +321,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -395,13 +395,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -409,7 +409,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -470,7 +470,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -478,7 +478,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -534,7 +534,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -550,7 +550,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -559,13 +559,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -667,7 +675,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -677,7 +685,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -691,7 +699,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -699,14 +707,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -766,19 +774,19 @@ server cluster GeneralDiagnostics = 51 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -788,7 +796,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -883,21 +891,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -910,7 +922,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -924,12 +936,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -971,7 +983,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -979,14 +991,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1009,12 +1021,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1025,7 +1037,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1040,12 +1052,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1112,7 +1124,7 @@ server cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling pumps. */ client cluster PumpConfigurationAndControl = 512 { - enum ControlModeEnum : ENUM8 { + enum ControlModeEnum : enum8 { kConstantSpeed = 0; kConstantPressure = 1; kProportionalPressure = 2; @@ -1121,14 +1133,14 @@ client cluster PumpConfigurationAndControl = 512 { kAutomatic = 7; } - enum OperationModeEnum : ENUM8 { + enum OperationModeEnum : enum8 { kNormal = 0; kMinimum = 1; kMaximum = 2; kLocal = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kConstantPressure = 0x1; kCompensatedPressure = 0x2; kConstantFlow = 0x4; @@ -1138,9 +1150,9 @@ client cluster PumpConfigurationAndControl = 512 { kLocalOperation = 0x40; } - bitmap PumpStatusBitmap : BITMAP16 { + bitmap PumpStatusBitmap : bitmap16 { kDeviceFault = 0x1; - kSupplyfault = 0x2; + kSupplyFault = 0x2; kSpeedLow = 0x4; kSpeedHigh = 0x8; kLocalOverride = 0x10; @@ -1234,10 +1246,10 @@ client cluster PumpConfigurationAndControl = 512 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ client cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; - readonly attribute optional int16u tolerance = 3; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; + readonly attribute optional temperature tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1248,7 +1260,7 @@ client cluster TemperatureMeasurement = 1026 { /** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ client cluster PressureMeasurement = 1027 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kExtended = 0x1; } diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 40a48ff65a05f1..cb7f4b298c5fbb 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -2160,7 +2160,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3416,5 +3416,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 14153386de3b5e..6e3fa7ef3b0b88 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -26,7 +26,7 @@ your own pump application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index f36f326925dacd..d9bc12cf315e95 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -3,7 +3,7 @@ /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -37,13 +37,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -51,7 +51,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -109,7 +109,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -133,7 +133,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -200,7 +200,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -215,7 +215,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -230,12 +230,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -253,13 +253,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -274,7 +274,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -282,7 +282,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -338,7 +338,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -354,7 +354,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -363,13 +363,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -478,7 +486,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -488,7 +496,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -502,7 +510,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -510,14 +518,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -583,19 +591,19 @@ server cluster GeneralDiagnostics = 51 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -604,7 +612,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -614,7 +622,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -657,21 +665,25 @@ server cluster WiFiNetworkDiagnostics = 54 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -684,7 +696,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -698,12 +710,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -745,7 +757,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -753,14 +765,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -783,12 +795,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -799,7 +811,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -814,12 +826,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -886,7 +898,7 @@ server cluster GroupKeyManagement = 63 { /** Attributes and commands for configuring the temperature control, and reporting temperature. */ server cluster TemperatureControl = 86 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureNumber = 0x1; kTemperatureLevel = 0x2; kTemperatureStep = 0x4; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index ee25bbda679588..b772acad198770 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -2307,7 +2307,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3717,5 +3717,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index dd6e4bfb9b90b4..e8ad6f4689e6d9 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -462,7 +462,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -477,7 +477,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -492,12 +492,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -514,7 +514,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -522,7 +522,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -578,7 +578,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -594,7 +594,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -603,13 +603,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -718,13 +726,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -732,7 +740,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -755,7 +763,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -765,7 +773,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -779,7 +787,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -787,14 +795,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -860,8 +868,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -889,24 +897,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -916,7 +924,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1057,19 +1065,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1078,7 +1086,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1088,7 +1096,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1131,7 +1139,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1144,7 +1152,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1165,14 +1173,14 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ server cluster Switch = 59 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLatchingSwitch = 0x1; kMomentarySwitch = 0x2; kMomentarySwitchRelease = 0x4; @@ -1222,21 +1230,25 @@ server cluster Switch = 59 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1249,7 +1261,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1263,12 +1275,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1310,7 +1322,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1318,14 +1330,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1348,12 +1360,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1364,7 +1376,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1379,12 +1391,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1484,18 +1496,18 @@ server cluster UserLabel = 65 { /** Attributes and commands for monitoring HEPA filters in a device */ server cluster HepaFilterMonitoring = 113 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -1503,7 +1515,7 @@ server cluster HepaFilterMonitoring = 113 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -1532,18 +1544,18 @@ server cluster HepaFilterMonitoring = 113 { /** Attributes and commands for monitoring activated carbon filters in a device */ server cluster ActivatedCarbonFilterMonitoring = 114 { - enum ChangeIndicationEnum : ENUM8 { + enum ChangeIndicationEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum DegradationDirectionEnum : ENUM8 { + enum DegradationDirectionEnum : enum8 { kUp = 0; kDown = 1; } - enum ProductIdentifierTypeEnum : ENUM8 { + enum ProductIdentifierTypeEnum : enum8 { kUPC = 0; kGTIN8 = 1; kEAN = 2; @@ -1551,7 +1563,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { kOEM = 4; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCondition = 0x1; kWarning = 0x2; kReplacementProductList = 0x4; @@ -1580,12 +1592,12 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for controlling a fan in a heating/cooling system. */ provisional server cluster FanControl = 514 { - enum AirflowDirectionEnum : ENUM8 { + enum AirflowDirectionEnum : enum8 { kForward = 0; kReverse = 1; } - enum FanModeEnum : ENUM8 { + enum FanModeEnum : enum8 { kOff = 0; kLow = 1; kMedium = 2; @@ -1595,7 +1607,7 @@ provisional server cluster FanControl = 514 { kSmart = 6; } - enum FanModeSequenceEnum : ENUM8 { + enum FanModeSequenceEnum : enum8 { kOffLowMedHigh = 0; kOffLowHigh = 1; kOffLowMedHighAuto = 2; @@ -1604,12 +1616,12 @@ provisional server cluster FanControl = 514 { kOffOn = 5; } - enum StepDirectionEnum : ENUM8 { + enum StepDirectionEnum : enum8 { kIncrease = 0; kDecrease = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kMultiSpeed = 0x1; kAuto = 0x2; kRocking = 0x4; @@ -1618,13 +1630,13 @@ provisional server cluster FanControl = 514 { kAirflowDirection = 0x20; } - bitmap RockBitmap : BITMAP8 { + bitmap RockBitmap : bitmap8 { kRockLeftRight = 0x1; kRockUpDown = 0x2; kRockRound = 0x4; } - bitmap WindBitmap : BITMAP8 { + bitmap WindBitmap : bitmap8 { kSleepWind = 0x1; kNaturalWind = 0x2; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 8c7e341e96e664..f9ec6ae993d322 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -3694,7 +3694,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5157,6 +5157,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -5322,5 +5323,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/telink/README.md b/examples/resource-monitoring-app/telink/README.md index 3b6645171511e0..e418ad345911d1 100644 --- a/examples/resource-monitoring-app/telink/README.md +++ b/examples/resource-monitoring-app/telink/README.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/rvc-app/README.md b/examples/rvc-app/README.md index cd8bc0461fcbc1..fa723f24d35712 100644 --- a/examples/rvc-app/README.md +++ b/examples/rvc-app/README.md @@ -69,11 +69,8 @@ transition to mode 2", set the `RvcRunMode` to 0. #### TC 3.2 -PIXIT: `PIXIT_ENDPOINT:1` -Example command: -`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCCLEANM_3_2.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1"` - -When asked "Physically power cycle the device", do so. +This is not applicable because this RVC device does not support the +`StartUpMode` attribute. ### RVC Run Mode cluster diff --git a/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml b/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml index c5776d9553a9bb..ce0ddaa38b5307 100644 --- a/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml +++ b/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml @@ -61,7 +61,7 @@ Draft Does the device implement the StartUpMode attribute? 89.2.2. Attributes - allclusters.html[pdf] O - true + false RVCCLEANM.S.A0003 diff --git a/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt b/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt index c4c5ef7586bdce..d0c8529a83d2e0 100644 --- a/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt +++ b/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt @@ -1,7 +1,7 @@ RVCCLEANM.S=1 RVCCLEANM.S.A0000=1 RVCCLEANM.S.A0001=1 -RVCCLEANM.S.A0002=1 +RVCCLEANM.S.A0002=0 RVCCLEANM.S.A0003=0 RVCCLEANM.S.C01.Tx=1 RVCCLEANM.S.C00.Rsp=1 diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 1c944bf51fc41f..4822febc1d0239 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,7 +49,7 @@ server cluster Identify = 3 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -82,13 +82,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -96,7 +96,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -154,7 +154,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -178,7 +178,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -241,7 +241,7 @@ server cluster BasicInformation = 40 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -249,7 +249,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -305,7 +305,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -321,7 +321,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -330,13 +330,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -445,13 +453,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -459,7 +467,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -482,7 +490,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -492,7 +500,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -506,7 +514,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -514,14 +522,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -587,21 +595,25 @@ server cluster GeneralDiagnostics = 51 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -614,7 +626,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -628,12 +640,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -675,7 +687,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -683,14 +695,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -713,12 +725,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -729,7 +741,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -744,12 +756,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -816,12 +828,12 @@ server cluster GroupKeyManagement = 63 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcRunMode = 84 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kIdle = 16384; kCleaning = 16385; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kStuck = 65; kDustBinMissing = 66; kDustBinFull = 67; @@ -832,7 +844,7 @@ server cluster RvcRunMode = 84 { kBatteryLow = 72; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -870,17 +882,17 @@ server cluster RvcRunMode = 84 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcCleanMode = 85 { - enum ModeTag : ENUM16 { + enum ModeTag : enum16 { kDeepClean = 16384; kVacuum = 16385; kMop = 16386; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kCleaningInProgress = 64; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; } @@ -897,7 +909,6 @@ server cluster RvcCleanMode = 85 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute nullable int8u startUpMode = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -919,7 +930,7 @@ server cluster RvcCleanMode = 85 { /** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ server cluster RvcOperationalState = 97 { - enum ErrorStateEnum : ENUM8 { + enum ErrorStateEnum : enum8 { kFailedToFindChargingDock = 64; kStuck = 65; kDustBinMissing = 66; @@ -930,7 +941,7 @@ server cluster RvcOperationalState = 97 { kMopCleaningPadMissing = 71; } - enum OperationalStateEnum : ENUM8 { + enum OperationalStateEnum : enum8 { kSeekingCharger = 64; kCharging = 65; kDocked = 66; @@ -1185,7 +1196,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; @@ -1194,13 +1205,12 @@ endpoint 1 { server cluster RvcCleanMode { callback attribute supportedModes; callback attribute currentMode; - callback attribute startUpMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command ChangeToMode; handle command ChangeToModeResponse; diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap index 9c0844f84190aa..a9f67c56bd7bc8 100644 --- a/examples/rvc-app/rvc-common/rvc-app.zap +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -1433,7 +1433,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2373,7 +2373,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2439,22 +2439,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "StartUpMode", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "GeneratedCommandList", "code": 65528, @@ -2545,7 +2529,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2799,5 +2783,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp index da7a8bcccbd262..2ee199d158a84a 100644 --- a/examples/rvc-app/rvc-common/src/rvc-device.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -39,9 +39,9 @@ void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::Ch // We could be in the charging state with an RvcRun mode != idle. if (currentMode != RvcRunMode::ModeIdle && newMode != RvcRunMode::ModeIdle) { - response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode); response.statusText.SetValue( - chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle")); + chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle.")); return; } @@ -56,9 +56,9 @@ void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::Ch case to_underlying(OperationalState::OperationalStateEnum::kRunning): { if (newMode != RvcRunMode::ModeIdle) { - response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode); response.statusText.SetValue( - chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle")); + chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle.")); return; } @@ -71,8 +71,8 @@ void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::Ch } // If we fall through at any point, it's because the change is not supported in the current state. - response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); - response.statusText.SetValue(chip::CharSpan::fromCharString("This change is not allowed at this time. ")); + response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode); + response.statusText.SetValue(chip::CharSpan::fromCharString("This change is not allowed at this time.")); } void RvcDevice::HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) diff --git a/examples/shell/cc13x2x7_26x2x7/README.md b/examples/shell/cc13x2x7_26x2x7/README.md index 478e3dc8821bd7..69fdf781446afd 100644 --- a/examples/shell/cc13x2x7_26x2x7/README.md +++ b/examples/shell/cc13x2x7_26x2x7/README.md @@ -16,9 +16,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -45,7 +45,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -54,7 +54,7 @@ Ninja to build the executable. OR $ cd ~/connectedhomeip/examples/shell/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\"" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\"" $ ninja -C out/debug ``` @@ -63,7 +63,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/shell/cc13x4_26x4/README.md b/examples/shell/cc13x4_26x4/README.md index 9145e19f58ad07..08be886e6fb86e 100644 --- a/examples/shell/cc13x4_26x4/README.md +++ b/examples/shell/cc13x4_26x4/README.md @@ -16,9 +16,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04. ``` $ cd ~ - $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run` - $ chmod +x sysconfig-1.15.0_2826-setup.run - $ ./sysconfig-1.15.0_2826-setup.run + $ `wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run` + $ chmod +x sysconfig-1.16.2_3028-setup.run + $ ./sysconfig-1.16.2_3028-setup.run ``` - Run the bootstrap script to setup the build environment. @@ -45,7 +45,7 @@ Ninja to build the executable. - Run the build to produce a default executable. By default on Linux both the TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's home directory, and you must provide the absolute path to them. For example - `/home/username/ti/sysconfig_1.15.0`. On Windows the default directory is + `/home/username/ti/sysconfig_1.16.2`. On Windows the default directory is `C:\ti`. Take note of this install path, as it will be used in the next step. @@ -53,7 +53,7 @@ Ninja to build the executable. $ cd ~/connectedhomeip/examples/shell/cc13x2x7_26x2x7 OR $ cd ~/connectedhomeip/examples/shell/cc13x4_26x4 - $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15" + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2" $ ninja -C out/debug ``` @@ -62,7 +62,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.15.0\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.16.2\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" ``` ## Programming diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index 2ff00f0046473f..744a0498a8f7d4 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/smoke-co-alarm-app/silabs/include/CHIPProjectConfig.h b/examples/smoke-co-alarm-app/silabs/include/CHIPProjectConfig.h index 692a486448d6c7..4d5f7f1a9807b9 100644 --- a/examples/smoke-co-alarm-app/silabs/include/CHIPProjectConfig.h +++ b/examples/smoke-co-alarm-app/silabs/include/CHIPProjectConfig.h @@ -98,5 +98,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 94f2a7e6df475b..48642e7abbf947 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -462,7 +462,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -477,7 +477,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -492,12 +492,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -514,7 +514,7 @@ server cluster TimeFormatLocalization = 44 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -550,7 +550,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -564,20 +564,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -661,38 +661,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -746,7 +746,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -754,7 +754,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -810,7 +810,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -826,7 +826,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -835,13 +835,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -950,13 +958,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -964,7 +972,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -987,7 +995,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -997,7 +1005,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1011,7 +1019,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1019,14 +1027,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1092,8 +1100,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1121,24 +1129,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1148,7 +1156,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1289,21 +1297,25 @@ server cluster ThreadNetworkDiagnostics = 53 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1316,7 +1328,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1330,12 +1342,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1377,7 +1389,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1385,14 +1397,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1415,12 +1427,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1431,7 +1443,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1446,12 +1458,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1551,8 +1563,30 @@ server cluster UserLabel = 65 { /** Allows servers to ensure that listed clients are notified when a server is available for communication. */ server cluster IcdManagement = 70 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; } fabric_scoped struct MonitoringRegistrationStruct { @@ -1561,8 +1595,8 @@ server cluster IcdManagement = 70 { fabric_idx fabricIndex = 254; } - readonly attribute int32u idleModeInterval = 0; - readonly attribute int32u activeModeInterval = 1; + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; readonly attribute int16u activeModeThreshold = 2; readonly attribute access(read: administer) MonitoringRegistrationStruct registeredClients[] = 3; readonly attribute access(read: administer) int32u ICDCounter = 4; @@ -1597,25 +1631,25 @@ server cluster IcdManagement = 70 { /** This cluster provides an interface for observing and managing the state of smoke and CO alarms. */ server cluster SmokeCoAlarm = 92 { - enum AlarmStateEnum : ENUM8 { + enum AlarmStateEnum : enum8 { kNormal = 0; kWarning = 1; kCritical = 2; } - enum ContaminationStateEnum : ENUM8 { + enum ContaminationStateEnum : enum8 { kNormal = 0; kLow = 1; kWarning = 2; kCritical = 3; } - enum EndOfServiceEnum : ENUM8 { + enum EndOfServiceEnum : enum8 { kNormal = 0; kExpired = 1; } - enum ExpressedStateEnum : ENUM8 { + enum ExpressedStateEnum : enum8 { kNormal = 0; kSmokeAlarm = 1; kCOAlarm = 2; @@ -1627,18 +1661,18 @@ server cluster SmokeCoAlarm = 92 { kInterconnectCO = 8; } - enum MuteStateEnum : ENUM8 { + enum MuteStateEnum : enum8 { kNotMuted = 0; kMuted = 1; } - enum SensitivityEnum : ENUM8 { + enum SensitivityEnum : enum8 { kHigh = 0; kStandard = 1; kLow = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSmokeAlarm = 0x1; kCOAlarm = 0x2; } @@ -1692,7 +1726,7 @@ server cluster SmokeCoAlarm = 92 { readonly attribute AlarmStateEnum interconnectSmokeAlarm = 8; readonly attribute AlarmStateEnum interconnectCOAlarm = 9; readonly attribute ContaminationStateEnum contaminationState = 10; - attribute SensitivityEnum smokeSensitivityLevel = 11; + attribute access(write: manage) SensitivityEnum smokeSensitivityLevel = 11; readonly attribute epoch_s expiryDate = 12; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1988,8 +2022,8 @@ endpoint 0 { } server cluster IcdManagement { - callback attribute idleModeInterval default = 500; - callback attribute activeModeInterval default = 300; + callback attribute idleModeDuration default = 500; + callback attribute activeModeDuration default = 300; callback attribute activeModeThreshold default = 300; callback attribute registeredClients; callback attribute ICDCounter; @@ -1998,7 +2032,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 1; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; handle command RegisterClient; handle command RegisterClientResponse; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index 5d3c2bfc203f0e..b5fe6c12387788 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -2909,7 +2909,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -3505,7 +3505,7 @@ ], "attributes": [ { - "name": "IdleModeInterval", + "name": "IdleModeDuration", "code": 0, "mfgCode": null, "side": "server", @@ -3521,7 +3521,7 @@ "reportableChange": 0 }, { - "name": "ActiveModeInterval", + "name": "ActiveModeDuration", "code": 1, "mfgCode": null, "side": "server", @@ -3674,7 +3674,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4833,5 +4833,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index f36ecb97d5925e..71fc7afd668a23 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index fda373eedf2ca9..77558a8968472a 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -25,7 +25,7 @@ creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 08377ffb656f81..187f8d14112801 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -3,7 +3,7 @@ /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -36,13 +36,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -50,7 +50,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -108,7 +108,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -132,7 +132,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -198,7 +198,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -213,7 +213,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -228,12 +228,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -253,13 +253,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -274,7 +274,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -282,7 +282,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -338,7 +338,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -354,7 +354,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -363,13 +363,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -472,13 +480,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -486,7 +494,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -509,7 +517,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -519,7 +527,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -533,7 +541,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -541,14 +549,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -614,8 +622,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -643,19 +651,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -664,7 +672,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -674,7 +682,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -715,7 +723,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -728,7 +736,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -749,26 +757,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -781,7 +793,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -795,12 +807,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -842,7 +854,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -850,14 +862,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -880,12 +892,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -896,7 +908,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -911,12 +923,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1016,9 +1028,9 @@ server cluster UserLabel = 65 { /** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ server cluster TemperatureMeasurement = 1026 { - readonly attribute nullable int16s measuredValue = 0; - readonly attribute nullable int16s minMeasuredValue = 1; - readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute nullable temperature measuredValue = 0; + readonly attribute nullable temperature minMeasuredValue = 1; + readonly attribute nullable temperature maxMeasuredValue = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 63fe575d9d2914..7845ed393315aa 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -2174,7 +2174,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -2970,5 +2970,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/BUILD.gn b/examples/thermostat/nxp/zap/BUILD.gn new file mode 100644 index 00000000000000..976cd78f2e1a79 --- /dev/null +++ b/examples/thermostat/nxp/zap/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2020 Project CHIP Authors +# Copyright 2023 NXP +# +# 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}/src/app/chip_data_model.gni") + +import("${chip_root}/src/platform/device.gni") + +chip_data_model("zap") { + if (chip_enable_wifi) { + # zap config for matter-over-wifi + zap_file = "thermostat_matter_wifi.zap" + } else { + # zap config for matter-over-thread + zap_file = "thermostat_matter_thread.zap" + } + + # Defining zap_pregenerated_dir is required by chip_data_model.gni in order to build IMClusterCommandHandler.cpp + zap_pregenerated_dir = "" + is_server = true +} diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter new file mode 100644 index 00000000000000..a581f1f70d285d --- /dev/null +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -0,0 +1,2206 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +client cluster Identify = 3 { + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for group configuration and manipulation. */ +server cluster Groups = 4 { + bitmap Feature : bitmap32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : bitmap8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + response struct AddGroupResponse = 0 { + enum8 status = 0; + group_id groupID = 1; + } + + response struct ViewGroupResponse = 1 { + enum8 status = 0; + group_id groupID = 1; + char_string<16> groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable int8u capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + enum8 status = 0; + group_id groupID = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** Attributes and commands for scene configuration and manipulation. */ +provisional server cluster Scenes = 5 { + bitmap Feature : bitmap32 { + kSceneNames = 0x1; + kExplicit = 0x2; + kTableSize = 0x4; + kFabricScenes = 0x8; + } + + bitmap ScenesCopyMode : bitmap8 { + kCopyAllScenes = 0x1; + } + + struct AttributeValuePair { + attrib_id attributeID = 0; + int32u attributeValue = 1; + } + + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + + readonly attribute int8u sceneCount = 0; + readonly attribute int8u currentScene = 1; + readonly attribute group_id currentGroup = 2; + readonly attribute boolean sceneValid = 3; + readonly attribute bitmap8 nameSupport = 4; + readonly attribute int16u sceneTableSize = 6; + readonly attribute int8u remainingCapacity = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + int16u transitionTime = 2; + char_string sceneName = 3; + ExtensionFieldSet extensionFieldSets[] = 4; + } + + request struct ViewSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RemoveSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RemoveAllScenesRequest { + group_id groupID = 0; + } + + request struct StoreSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RecallSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + optional nullable int16u transitionTime = 2; + } + + request struct GetSceneMembershipRequest { + group_id groupID = 0; + } + + response struct AddSceneResponse = 0 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct ViewSceneResponse = 1 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + optional int16u transitionTime = 3; + optional char_string sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; + } + + response struct RemoveSceneResponse = 2 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct RemoveAllScenesResponse = 3 { + status status = 0; + group_id groupID = 1; + } + + response struct StoreSceneResponse = 4 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct GetSceneMembershipResponse = 6 { + status status = 0; + nullable int8u capacity = 1; + group_id groupID = 2; + optional int8u sceneList[] = 3; + } + + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +server cluster Binding = 30 { + fabric_scoped struct TargetStruct { + optional node_id node = 1; + optional group_id group = 2; + optional endpoint_no endpoint = 3; + optional cluster_id cluster = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(write: manage) TargetStruct binding[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : enum8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + attribute CalendarTypeEnum activeCalendarType = 1; + readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +server cluster UnitLocalization = 45 { + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute TempUnitEnum temperatureUnit = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +server cluster PowerSource = 47 { + enum BatApprovedChemistryEnum : enum16 { + kUnspecified = 0; + kAlkaline = 1; + kLithiumCarbonFluoride = 2; + kLithiumChromiumOxide = 3; + kLithiumCopperOxide = 4; + kLithiumIronDisulfide = 5; + kLithiumManganeseDioxide = 6; + kLithiumThionylChloride = 7; + kMagnesium = 8; + kMercuryOxide = 9; + kNickelOxyhydride = 10; + kSilverOxide = 11; + kZincAir = 12; + kZincCarbon = 13; + kZincChloride = 14; + kZincManganeseDioxide = 15; + kLeadAcid = 16; + kLithiumCobaltOxide = 17; + kLithiumIon = 18; + kLithiumIonPolymer = 19; + kLithiumIronPhosphate = 20; + kLithiumSulfur = 21; + kLithiumTitanate = 22; + kNickelCadmium = 23; + kNickelHydrogen = 24; + kNickelIron = 25; + kNickelMetalHydride = 26; + kNickelZinc = 27; + kSilverZinc = 28; + kSodiumIon = 29; + kSodiumSulfur = 30; + kZincBromide = 31; + kZincCerium = 32; + } + + enum BatChargeFaultEnum : enum8 { + kUnspecified = 0; + kAmbientTooHot = 1; + kAmbientTooCold = 2; + kBatteryTooHot = 3; + kBatteryTooCold = 4; + kBatteryAbsent = 5; + kBatteryOverVoltage = 6; + kBatteryUnderVoltage = 7; + kChargerOverVoltage = 8; + kChargerUnderVoltage = 9; + kSafetyTimeout = 10; + } + + enum BatChargeLevelEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum BatChargeStateEnum : enum8 { + kUnknown = 0; + kIsCharging = 1; + kIsAtFullCharge = 2; + kIsNotCharging = 3; + } + + enum BatCommonDesignationEnum : enum16 { + kUnspecified = 0; + kAAA = 1; + kAA = 2; + kC = 3; + kD = 4; + k4v5 = 5; + k6v0 = 6; + k9v0 = 7; + k12AA = 8; + kAAAA = 9; + kA = 10; + kB = 11; + kF = 12; + kN = 13; + kNo6 = 14; + kSubC = 15; + kA23 = 16; + kA27 = 17; + kBA5800 = 18; + kDuplex = 19; + k4SR44 = 20; + k523 = 21; + k531 = 22; + k15v0 = 23; + k22v5 = 24; + k30v0 = 25; + k45v0 = 26; + k67v5 = 27; + kJ = 28; + kCR123A = 29; + kCR2 = 30; + k2CR5 = 31; + kCRP2 = 32; + kCRV3 = 33; + kSR41 = 34; + kSR43 = 35; + kSR44 = 36; + kSR45 = 37; + kSR48 = 38; + kSR54 = 39; + kSR55 = 40; + kSR57 = 41; + kSR58 = 42; + kSR59 = 43; + kSR60 = 44; + kSR63 = 45; + kSR64 = 46; + kSR65 = 47; + kSR66 = 48; + kSR67 = 49; + kSR68 = 50; + kSR69 = 51; + kSR516 = 52; + kSR731 = 53; + kSR712 = 54; + kLR932 = 55; + kA5 = 56; + kA10 = 57; + kA13 = 58; + kA312 = 59; + kA675 = 60; + kAC41E = 61; + k10180 = 62; + k10280 = 63; + k10440 = 64; + k14250 = 65; + k14430 = 66; + k14500 = 67; + k14650 = 68; + k15270 = 69; + k16340 = 70; + kRCR123A = 71; + k17500 = 72; + k17670 = 73; + k18350 = 74; + k18500 = 75; + k18650 = 76; + k19670 = 77; + k25500 = 78; + k26650 = 79; + k32600 = 80; + } + + enum BatFaultEnum : enum8 { + kUnspecified = 0; + kOverTemp = 1; + kUnderTemp = 2; + } + + enum BatReplaceabilityEnum : enum8 { + kUnspecified = 0; + kNotReplaceable = 1; + kUserReplaceable = 2; + kFactoryReplaceable = 3; + } + + enum PowerSourceStatusEnum : enum8 { + kUnspecified = 0; + kActive = 1; + kStandby = 2; + kUnavailable = 3; + } + + enum WiredCurrentTypeEnum : enum8 { + kAC = 0; + kDC = 1; + } + + enum WiredFaultEnum : enum8 { + kUnspecified = 0; + kOverVoltage = 1; + kUnderVoltage = 2; + } + + bitmap Feature : bitmap32 { + kWired = 0x1; + kBattery = 0x2; + kRechargeable = 0x4; + kReplaceable = 0x8; + } + + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event WiredFaultChange = 0 { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + readonly attribute PowerSourceStatusEnum status = 0; + readonly attribute int8u order = 1; + readonly attribute char_string<60> description = 2; + readonly attribute WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute endpoint_no endpointList[] = 31; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string countryCode = 1; + int64u breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ +server cluster ThreadNetworkDiagnostics = 53 { + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kLinkDown = 1; + kHardwareFailure = 2; + kNetworkJammed = 3; + } + + enum RoutingRoleEnum : enum8 { + kUnspecified = 0; + kUnassigned = 1; + kSleepyEndDevice = 2; + kEndDevice = 3; + kREED = 4; + kRouter = 5; + kLeader = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + kMLECounts = 0x4; + kMACCounts = 0x8; + } + + struct NeighborTableStruct { + int64u extAddress = 0; + int32u age = 1; + int16u rloc16 = 2; + int32u linkFrameCounter = 3; + int32u mleFrameCounter = 4; + int8u lqi = 5; + nullable int8s averageRssi = 6; + nullable int8s lastRssi = 7; + int8u frameErrorRate = 8; + int8u messageErrorRate = 9; + boolean rxOnWhenIdle = 10; + boolean fullThreadDevice = 11; + boolean fullNetworkData = 12; + boolean isChild = 13; + } + + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + + struct RouteTableStruct { + int64u extAddress = 0; + int16u rloc16 = 1; + int8u routerId = 2; + int8u nextHop = 3; + int8u pathCost = 4; + int8u LQIIn = 5; + int8u LQIOut = 6; + int8u age = 7; + boolean allocated = 8; + boolean linkEstablished = 9; + } + + struct SecurityPolicy { + int16u rotationTime = 0; + int16u flags = 1; + } + + info event ConnectionStatus = 0 { + ConnectionStatusEnum connectionStatus = 0; + } + + info event NetworkFaultChange = 1 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + readonly attribute nullable int16u channel = 0; + readonly attribute nullable RoutingRoleEnum routingRole = 1; + readonly attribute nullable char_string<16> networkName = 2; + readonly attribute nullable int16u panId = 3; + readonly attribute nullable int64u extendedPanId = 4; + readonly attribute nullable octet_string<17> meshLocalPrefix = 5; + readonly attribute int64u overrunCount = 6; + readonly attribute NeighborTableStruct neighborTable[] = 7; + readonly attribute RouteTableStruct routeTable[] = 8; + readonly attribute nullable int32u partitionId = 9; + readonly attribute nullable int8u weighting = 10; + readonly attribute nullable int8u dataVersion = 11; + readonly attribute nullable int8u stableDataVersion = 12; + readonly attribute nullable int8u leaderRouterId = 13; + readonly attribute int16u detachedRoleCount = 14; + readonly attribute int16u childRoleCount = 15; + readonly attribute int16u routerRoleCount = 16; + readonly attribute int16u leaderRoleCount = 17; + readonly attribute int16u attachAttemptCount = 18; + readonly attribute int16u partitionIdChangeCount = 19; + readonly attribute int16u betterPartitionAttachAttemptCount = 20; + readonly attribute int16u parentChangeCount = 21; + readonly attribute int32u txTotalCount = 22; + readonly attribute int32u txUnicastCount = 23; + readonly attribute int32u txBroadcastCount = 24; + readonly attribute int32u txAckRequestedCount = 25; + readonly attribute int32u txAckedCount = 26; + readonly attribute int32u txNoAckRequestedCount = 27; + readonly attribute int32u txDataCount = 28; + readonly attribute int32u txDataPollCount = 29; + readonly attribute int32u txBeaconCount = 30; + readonly attribute int32u txBeaconRequestCount = 31; + readonly attribute int32u txOtherCount = 32; + readonly attribute int32u txRetryCount = 33; + readonly attribute int32u txDirectMaxRetryExpiryCount = 34; + readonly attribute int32u txIndirectMaxRetryExpiryCount = 35; + readonly attribute int32u txErrCcaCount = 36; + readonly attribute int32u txErrAbortCount = 37; + readonly attribute int32u txErrBusyChannelCount = 38; + readonly attribute int32u rxTotalCount = 39; + readonly attribute int32u rxUnicastCount = 40; + readonly attribute int32u rxBroadcastCount = 41; + readonly attribute int32u rxDataCount = 42; + readonly attribute int32u rxDataPollCount = 43; + readonly attribute int32u rxBeaconCount = 44; + readonly attribute int32u rxBeaconRequestCount = 45; + readonly attribute int32u rxOtherCount = 46; + readonly attribute int32u rxAddressFilteredCount = 47; + readonly attribute int32u rxDestAddrFilteredCount = 48; + readonly attribute int32u rxDuplicatedCount = 49; + readonly attribute int32u rxErrNoFrameCount = 50; + readonly attribute int32u rxErrUnknownNeighborCount = 51; + readonly attribute int32u rxErrInvalidSrcAddrCount = 52; + readonly attribute int32u rxErrSecCount = 53; + readonly attribute int32u rxErrFcsCount = 54; + readonly attribute int32u rxErrOtherCount = 55; + readonly attribute nullable int64u activeTimestamp = 56; + readonly attribute nullable int64u pendingTimestamp = 57; + readonly attribute nullable int32u delay = 58; + readonly attribute nullable SecurityPolicy securityPolicy = 59; + readonly attribute nullable octet_string<4> channelPage0Mask = 60; + readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61; + readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** An interface for configuring and controlling the functionality of a thermostat. */ +server cluster Thermostat = 513 { + enum SetpointAdjustMode : enum8 { + kHeat = 0; + kCool = 1; + kBoth = 2; + } + + enum ThermostatControlSequence : enum8 { + kCoolingOnly = 0; + kCoolingWithReheat = 1; + kHeatingOnly = 2; + kHeatingWithReheat = 3; + kCoolingAndHeating = 4; + kCoolingAndHeatingWithReheat = 5; + } + + enum ThermostatRunningMode : enum8 { + kOff = 0; + kCool = 3; + kHeat = 4; + } + + enum ThermostatSystemMode : enum8 { + kOff = 0; + kAuto = 1; + kCool = 3; + kHeat = 4; + kEmergencyHeat = 5; + kPrecooling = 6; + kFanOnly = 7; + kDry = 8; + kSleep = 9; + } + + bitmap DayOfWeek : bitmap8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + kAway = 0x80; + } + + bitmap Feature : bitmap32 { + kHeating = 0x1; + kCooling = 0x2; + kOccupancy = 0x4; + kScheduleConfiguration = 0x8; + kSetback = 0x10; + kAutoMode = 0x20; + kLocalTemperatureNotExposed = 0x40; + } + + bitmap ModeForSequence : bitmap8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + + struct ThermostatScheduleTransition { + int16u transitionTime = 0; + nullable int16s heatSetpoint = 1; + nullable int16s coolSetpoint = 2; + } + + readonly attribute nullable int16s localTemperature = 0; + readonly attribute int16s absMinHeatSetpointLimit = 3; + readonly attribute int16s absMaxHeatSetpointLimit = 4; + readonly attribute int16s absMinCoolSetpointLimit = 5; + readonly attribute int16s absMaxCoolSetpointLimit = 6; + attribute access(write: manage) bitmap8 HVACSystemTypeConfiguration = 9; + attribute int16s occupiedCoolingSetpoint = 17; + attribute int16s occupiedHeatingSetpoint = 18; + attribute access(write: manage) int16s minHeatSetpointLimit = 21; + attribute access(write: manage) int16s maxHeatSetpointLimit = 22; + attribute access(write: manage) int16s minCoolSetpointLimit = 23; + attribute access(write: manage) int16s maxCoolSetpointLimit = 24; + attribute access(write: manage) int8s minSetpointDeadBand = 25; + attribute access(write: manage) ThermostatControlSequence controlSequenceOfOperation = 27; + attribute access(write: manage) enum8 systemMode = 28; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetpointRaiseLowerRequest { + SetpointAdjustMode mode = 0; + int8s amount = 1; + } + + command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x00; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry default = 4; + callback attribute targetsPerAccessControlEntry default = 3; + callback attribute accessControlEntriesPerFabric default = 3; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + ram attribute reachable default = 1; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders default = 0; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + persist attribute temperatureUnit default = 0; + ram attribute featureMap default = 0x1; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command TestEventTrigger; + } + + server cluster ThreadNetworkDiagnostics { + callback attribute channel; + callback attribute routingRole; + callback attribute networkName default = "0"; + callback attribute panId default = 0x0000; + callback attribute extendedPanId default = 0x0000000000000000; + callback attribute meshLocalPrefix; + callback attribute overrunCount default = 0x0000000000000000; + callback attribute neighborTable; + callback attribute routeTable; + callback attribute partitionId; + callback attribute weighting; + callback attribute dataVersion; + callback attribute stableDataVersion; + callback attribute leaderRouterId; + callback attribute detachedRoleCount default = 0x0000; + callback attribute childRoleCount default = 0x0000; + callback attribute routerRoleCount default = 0x0000; + callback attribute leaderRoleCount default = 0x0000; + callback attribute attachAttemptCount default = 0x0000; + callback attribute partitionIdChangeCount default = 0x0000; + callback attribute betterPartitionAttachAttemptCount default = 0x0000; + callback attribute parentChangeCount default = 0x0000; + callback attribute txTotalCount default = 0x0000; + callback attribute txUnicastCount default = 0x0000; + callback attribute txBroadcastCount default = 0x0000; + callback attribute txAckRequestedCount default = 0x0000; + callback attribute txAckedCount default = 0x0000; + callback attribute txNoAckRequestedCount default = 0x0000; + callback attribute txDataCount default = 0x0000; + callback attribute txDataPollCount default = 0x0000; + callback attribute txBeaconCount default = 0x0000; + callback attribute txBeaconRequestCount default = 0x0000; + callback attribute txOtherCount default = 0x0000; + callback attribute txRetryCount default = 0x0000; + callback attribute txDirectMaxRetryExpiryCount default = 0x0000; + callback attribute txIndirectMaxRetryExpiryCount default = 0x0000; + callback attribute txErrCcaCount default = 0x0000; + callback attribute txErrAbortCount default = 0x0000; + callback attribute txErrBusyChannelCount default = 0x0000; + callback attribute rxTotalCount default = 0x0000; + callback attribute rxUnicastCount default = 0x0000; + callback attribute rxBroadcastCount default = 0x0000; + callback attribute rxDataCount default = 0x0000; + callback attribute rxDataPollCount default = 0x0000; + callback attribute rxBeaconCount default = 0x0000; + callback attribute rxBeaconRequestCount default = 0x0000; + callback attribute rxOtherCount default = 0x0000; + callback attribute rxAddressFilteredCount default = 0x0000; + callback attribute rxDestAddrFilteredCount default = 0x0000; + callback attribute rxDuplicatedCount default = 0x0000; + callback attribute rxErrNoFrameCount default = 0x0000; + callback attribute rxErrUnknownNeighborCount default = 0x0000; + callback attribute rxErrInvalidSrcAddrCount default = 0x0000; + callback attribute rxErrSecCount default = 0x0000; + callback attribute rxErrFcsCount default = 0x0000; + callback attribute rxErrOtherCount default = 0x0000; + callback attribute activeTimestamp default = 0x0000000000000000; + callback attribute pendingTimestamp default = 0x0000000000000000; + callback attribute delay default = 0x0000; + callback attribute securityPolicy; + callback attribute channelPage0Mask default = "0x0000"; + callback attribute operationalDatasetComponents; + callback attribute activeNetworkFaultsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0x000F; + ram attribute clusterRevision default = 1; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_thermostat = 769, version 1; + + binding cluster Identify; + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + } + + server cluster Groups { + ram attribute nameSupport; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command AddGroup; + handle command AddGroupResponse; + handle command ViewGroup; + handle command ViewGroupResponse; + handle command GetGroupMembership; + handle command GetGroupMembershipResponse; + handle command RemoveGroup; + handle command RemoveGroupResponse; + handle command RemoveAllGroups; + handle command AddGroupIfIdentifying; + } + + server cluster Scenes { + callback attribute sceneCount default = 0x00; + ram attribute currentScene default = 0x00; + ram attribute currentGroup default = 0x0000; + ram attribute sceneValid default = 0x00; + ram attribute nameSupport; + ram attribute sceneTableSize; + callback attribute remainingCapacity; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command AddScene; + handle command AddSceneResponse; + handle command ViewScene; + handle command ViewSceneResponse; + handle command RemoveScene; + handle command RemoveSceneResponse; + handle command RemoveAllScenes; + handle command RemoveAllScenesResponse; + handle command StoreScene; + handle command StoreSceneResponse; + handle command RecallScene; + handle command GetSceneMembership; + handle command GetSceneMembershipResponse; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster PowerSource { + ram attribute status; + ram attribute order; + ram attribute description; + ram attribute wiredCurrentType; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster FixedLabel { + callback attribute labelList; + callback attribute eventList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster Thermostat { + ram attribute localTemperature; + ram attribute absMinHeatSetpointLimit default = 700; + ram attribute absMaxHeatSetpointLimit default = 3000; + ram attribute absMinCoolSetpointLimit default = 1600; + ram attribute absMaxCoolSetpointLimit default = 3200; + ram attribute HVACSystemTypeConfiguration; + persist attribute occupiedCoolingSetpoint default = 0x0A28; + persist attribute occupiedHeatingSetpoint default = 0x07D0; + ram attribute minHeatSetpointLimit default = 700; + ram attribute maxHeatSetpointLimit default = 3000; + ram attribute minCoolSetpointLimit default = 1600; + ram attribute maxCoolSetpointLimit default = 3200; + ram attribute minSetpointDeadBand default = 0x19; + ram attribute controlSequenceOfOperation default = 0x04; + persist attribute systemMode default = 0x01; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0x3; + ram attribute clusterRevision default = 5; + + handle command SetpointRaiseLower; + } +} + + diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap new file mode 100644 index 00000000000000..ec8baf4d992228 --- /dev/null +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -0,0 +1,4939 @@ +{ + "fileFormat": 2, + "featureLevel": 99, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "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": 1, + "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": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-thermostat", + "deviceTypeRef": { + "code": 769, + "profileId": 259, + "label": "MA-thermostat", + "name": "MA-thermostat" + }, + "deviceTypes": [ + { + "code": 769, + "profileId": 259, + "label": "MA-thermostat", + "name": "MA-thermostat" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 769 + ], + "deviceTypeName": "MA-thermostat", + "deviceTypeCode": 769, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "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": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerSourceStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "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": "WiredCurrentType", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "WiredCurrentTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Thermostat", + "code": 513, + "mfgCode": null, + "define": "THERMOSTAT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetpointRaiseLower", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "LocalTemperature", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMinHeatSetpointLimit", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "700", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMaxHeatSetpointLimit", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMinCoolSetpointLimit", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1600", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMaxCoolSetpointLimit", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3200", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HVACSystemTypeConfiguration", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupiedCoolingSetpoint", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A28", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupiedHeatingSetpoint", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x07D0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinHeatSetpointLimit", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "700", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxHeatSetpointLimit", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinCoolSetpointLimit", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1600", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxCoolSetpointLimit", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3200", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinSetpointDeadBand", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x19", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ControlSequenceOfOperation", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "ThermostatControlSequence", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x04", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SystemMode", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "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": 1, + "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": "0x3", + "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": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "MA-thermostat", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter new file mode 100644 index 00000000000000..ede88c2f5677f3 --- /dev/null +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -0,0 +1,2060 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +client cluster Identify = 3 { + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for group configuration and manipulation. */ +server cluster Groups = 4 { + bitmap Feature : bitmap32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : bitmap8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + response struct AddGroupResponse = 0 { + enum8 status = 0; + group_id groupID = 1; + } + + response struct ViewGroupResponse = 1 { + enum8 status = 0; + group_id groupID = 1; + char_string<16> groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable int8u capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + enum8 status = 0; + group_id groupID = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** Attributes and commands for scene configuration and manipulation. */ +provisional server cluster Scenes = 5 { + bitmap Feature : bitmap32 { + kSceneNames = 0x1; + kExplicit = 0x2; + kTableSize = 0x4; + kFabricScenes = 0x8; + } + + bitmap ScenesCopyMode : bitmap8 { + kCopyAllScenes = 0x1; + } + + struct AttributeValuePair { + attrib_id attributeID = 0; + int32u attributeValue = 1; + } + + struct ExtensionFieldSet { + cluster_id clusterID = 0; + AttributeValuePair attributeValueList[] = 1; + } + + readonly attribute int8u sceneCount = 0; + readonly attribute int8u currentScene = 1; + readonly attribute group_id currentGroup = 2; + readonly attribute boolean sceneValid = 3; + readonly attribute bitmap8 nameSupport = 4; + readonly attribute int16u sceneTableSize = 6; + readonly attribute int8u remainingCapacity = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + int16u transitionTime = 2; + char_string sceneName = 3; + ExtensionFieldSet extensionFieldSets[] = 4; + } + + request struct ViewSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RemoveSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RemoveAllScenesRequest { + group_id groupID = 0; + } + + request struct StoreSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + } + + request struct RecallSceneRequest { + group_id groupID = 0; + int8u sceneID = 1; + optional nullable int16u transitionTime = 2; + } + + request struct GetSceneMembershipRequest { + group_id groupID = 0; + } + + response struct AddSceneResponse = 0 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct ViewSceneResponse = 1 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + optional int16u transitionTime = 3; + optional char_string sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; + } + + response struct RemoveSceneResponse = 2 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct RemoveAllScenesResponse = 3 { + status status = 0; + group_id groupID = 1; + } + + response struct StoreSceneResponse = 4 { + status status = 0; + group_id groupID = 1; + int8u sceneID = 2; + } + + response struct GetSceneMembershipResponse = 6 { + status status = 0; + nullable int8u capacity = 1; + group_id groupID = 2; + optional int8u sceneList[] = 3; + } + + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + fabric command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +server cluster Binding = 30 { + fabric_scoped struct TargetStruct { + optional node_id node = 1; + optional group_id group = 2; + optional endpoint_no endpoint = 3; + optional cluster_id cluster = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(write: manage) TargetStruct binding[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : enum8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + attribute CalendarTypeEnum activeCalendarType = 1; + readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +server cluster UnitLocalization = 45 { + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute TempUnitEnum temperatureUnit = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +server cluster PowerSource = 47 { + enum BatApprovedChemistryEnum : enum16 { + kUnspecified = 0; + kAlkaline = 1; + kLithiumCarbonFluoride = 2; + kLithiumChromiumOxide = 3; + kLithiumCopperOxide = 4; + kLithiumIronDisulfide = 5; + kLithiumManganeseDioxide = 6; + kLithiumThionylChloride = 7; + kMagnesium = 8; + kMercuryOxide = 9; + kNickelOxyhydride = 10; + kSilverOxide = 11; + kZincAir = 12; + kZincCarbon = 13; + kZincChloride = 14; + kZincManganeseDioxide = 15; + kLeadAcid = 16; + kLithiumCobaltOxide = 17; + kLithiumIon = 18; + kLithiumIonPolymer = 19; + kLithiumIronPhosphate = 20; + kLithiumSulfur = 21; + kLithiumTitanate = 22; + kNickelCadmium = 23; + kNickelHydrogen = 24; + kNickelIron = 25; + kNickelMetalHydride = 26; + kNickelZinc = 27; + kSilverZinc = 28; + kSodiumIon = 29; + kSodiumSulfur = 30; + kZincBromide = 31; + kZincCerium = 32; + } + + enum BatChargeFaultEnum : enum8 { + kUnspecified = 0; + kAmbientTooHot = 1; + kAmbientTooCold = 2; + kBatteryTooHot = 3; + kBatteryTooCold = 4; + kBatteryAbsent = 5; + kBatteryOverVoltage = 6; + kBatteryUnderVoltage = 7; + kChargerOverVoltage = 8; + kChargerUnderVoltage = 9; + kSafetyTimeout = 10; + } + + enum BatChargeLevelEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum BatChargeStateEnum : enum8 { + kUnknown = 0; + kIsCharging = 1; + kIsAtFullCharge = 2; + kIsNotCharging = 3; + } + + enum BatCommonDesignationEnum : enum16 { + kUnspecified = 0; + kAAA = 1; + kAA = 2; + kC = 3; + kD = 4; + k4v5 = 5; + k6v0 = 6; + k9v0 = 7; + k12AA = 8; + kAAAA = 9; + kA = 10; + kB = 11; + kF = 12; + kN = 13; + kNo6 = 14; + kSubC = 15; + kA23 = 16; + kA27 = 17; + kBA5800 = 18; + kDuplex = 19; + k4SR44 = 20; + k523 = 21; + k531 = 22; + k15v0 = 23; + k22v5 = 24; + k30v0 = 25; + k45v0 = 26; + k67v5 = 27; + kJ = 28; + kCR123A = 29; + kCR2 = 30; + k2CR5 = 31; + kCRP2 = 32; + kCRV3 = 33; + kSR41 = 34; + kSR43 = 35; + kSR44 = 36; + kSR45 = 37; + kSR48 = 38; + kSR54 = 39; + kSR55 = 40; + kSR57 = 41; + kSR58 = 42; + kSR59 = 43; + kSR60 = 44; + kSR63 = 45; + kSR64 = 46; + kSR65 = 47; + kSR66 = 48; + kSR67 = 49; + kSR68 = 50; + kSR69 = 51; + kSR516 = 52; + kSR731 = 53; + kSR712 = 54; + kLR932 = 55; + kA5 = 56; + kA10 = 57; + kA13 = 58; + kA312 = 59; + kA675 = 60; + kAC41E = 61; + k10180 = 62; + k10280 = 63; + k10440 = 64; + k14250 = 65; + k14430 = 66; + k14500 = 67; + k14650 = 68; + k15270 = 69; + k16340 = 70; + kRCR123A = 71; + k17500 = 72; + k17670 = 73; + k18350 = 74; + k18500 = 75; + k18650 = 76; + k19670 = 77; + k25500 = 78; + k26650 = 79; + k32600 = 80; + } + + enum BatFaultEnum : enum8 { + kUnspecified = 0; + kOverTemp = 1; + kUnderTemp = 2; + } + + enum BatReplaceabilityEnum : enum8 { + kUnspecified = 0; + kNotReplaceable = 1; + kUserReplaceable = 2; + kFactoryReplaceable = 3; + } + + enum PowerSourceStatusEnum : enum8 { + kUnspecified = 0; + kActive = 1; + kStandby = 2; + kUnavailable = 3; + } + + enum WiredCurrentTypeEnum : enum8 { + kAC = 0; + kDC = 1; + } + + enum WiredFaultEnum : enum8 { + kUnspecified = 0; + kOverVoltage = 1; + kUnderVoltage = 2; + } + + bitmap Feature : bitmap32 { + kWired = 0x1; + kBattery = 0x2; + kRechargeable = 0x4; + kReplaceable = 0x8; + } + + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event WiredFaultChange = 0 { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + readonly attribute PowerSourceStatusEnum status = 0; + readonly attribute int8u order = 1; + readonly attribute char_string<60> description = 2; + readonly attribute WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute endpoint_no endpointList[] = 31; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string countryCode = 1; + int64u breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster WiFiNetworkDiagnostics = 54 { + enum AssociationFailureCauseEnum : enum8 { + kUnknown = 0; + kAssociationFailed = 1; + kAuthenticationFailed = 2; + kSsidNotFound = 3; + } + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum SecurityTypeEnum : enum8 { + kUnspecified = 0; + kNone = 1; + kWEP = 2; + kWPA = 3; + kWPA2 = 4; + kWPA3 = 5; + } + + enum WiFiVersionEnum : enum8 { + kA = 0; + kB = 1; + kG = 2; + kN = 3; + kAc = 4; + kAx = 5; + kAh = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + info event Disconnection = 0 { + int16u reasonCode = 0; + } + + info event AssociationFailure = 1 { + AssociationFailureCauseEnum associationFailure = 0; + int16u status = 1; + } + + info event ConnectionStatus = 2 { + ConnectionStatusEnum connectionStatus = 0; + } + + readonly attribute nullable octet_string<6> bssid = 0; + readonly attribute nullable SecurityTypeEnum securityType = 1; + readonly attribute nullable WiFiVersionEnum wiFiVersion = 2; + readonly attribute nullable int16u channelNumber = 3; + readonly attribute nullable int8s rssi = 4; + readonly attribute nullable int32u beaconLostCount = 5; + readonly attribute nullable int32u beaconRxCount = 6; + readonly attribute nullable int32u packetMulticastRxCount = 7; + readonly attribute nullable int32u packetMulticastTxCount = 8; + readonly attribute nullable int32u packetUnicastRxCount = 9; + readonly attribute nullable int32u packetUnicastTxCount = 10; + readonly attribute nullable int64u currentMaxRate = 11; + readonly attribute nullable int64u overrunCount = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** An interface for configuring and controlling the functionality of a thermostat. */ +server cluster Thermostat = 513 { + enum SetpointAdjustMode : enum8 { + kHeat = 0; + kCool = 1; + kBoth = 2; + } + + enum ThermostatControlSequence : enum8 { + kCoolingOnly = 0; + kCoolingWithReheat = 1; + kHeatingOnly = 2; + kHeatingWithReheat = 3; + kCoolingAndHeating = 4; + kCoolingAndHeatingWithReheat = 5; + } + + enum ThermostatRunningMode : enum8 { + kOff = 0; + kCool = 3; + kHeat = 4; + } + + enum ThermostatSystemMode : enum8 { + kOff = 0; + kAuto = 1; + kCool = 3; + kHeat = 4; + kEmergencyHeat = 5; + kPrecooling = 6; + kFanOnly = 7; + kDry = 8; + kSleep = 9; + } + + bitmap DayOfWeek : bitmap8 { + kSunday = 0x1; + kMonday = 0x2; + kTuesday = 0x4; + kWednesday = 0x8; + kThursday = 0x10; + kFriday = 0x20; + kSaturday = 0x40; + kAway = 0x80; + } + + bitmap Feature : bitmap32 { + kHeating = 0x1; + kCooling = 0x2; + kOccupancy = 0x4; + kScheduleConfiguration = 0x8; + kSetback = 0x10; + kAutoMode = 0x20; + kLocalTemperatureNotExposed = 0x40; + } + + bitmap ModeForSequence : bitmap8 { + kHeatSetpointPresent = 0x1; + kCoolSetpointPresent = 0x2; + } + + struct ThermostatScheduleTransition { + int16u transitionTime = 0; + nullable int16s heatSetpoint = 1; + nullable int16s coolSetpoint = 2; + } + + readonly attribute nullable int16s localTemperature = 0; + readonly attribute int16s absMinHeatSetpointLimit = 3; + readonly attribute int16s absMaxHeatSetpointLimit = 4; + readonly attribute int16s absMinCoolSetpointLimit = 5; + readonly attribute int16s absMaxCoolSetpointLimit = 6; + attribute access(write: manage) bitmap8 HVACSystemTypeConfiguration = 9; + attribute int16s occupiedCoolingSetpoint = 17; + attribute int16s occupiedHeatingSetpoint = 18; + attribute access(write: manage) int16s minHeatSetpointLimit = 21; + attribute access(write: manage) int16s maxHeatSetpointLimit = 22; + attribute access(write: manage) int16s minCoolSetpointLimit = 23; + attribute access(write: manage) int16s maxCoolSetpointLimit = 24; + attribute access(write: manage) int8s minSetpointDeadBand = 25; + attribute access(write: manage) ThermostatControlSequence controlSequenceOfOperation = 27; + attribute access(write: manage) enum8 systemMode = 28; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetpointRaiseLowerRequest { + SetpointAdjustMode mode = 0; + int8s amount = 1; + } + + command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x00; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry default = 4; + callback attribute targetsPerAccessControlEntry default = 3; + callback attribute accessControlEntriesPerFabric default = 3; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + ram attribute reachable default = 1; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders default = 0; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AnnounceOTAProvider; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + persist attribute temperatureUnit default = 0; + ram attribute featureMap default = 0x1; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command TestEventTrigger; + } + + server cluster WiFiNetworkDiagnostics { + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber default = 0x0000; + callback attribute rssi default = 0x00; + callback attribute beaconLostCount default = 0x00000000; + callback attribute beaconRxCount default = 0x00000000; + callback attribute packetMulticastRxCount default = 0x00000000; + callback attribute packetMulticastTxCount default = 0x00000000; + callback attribute packetUnicastRxCount default = 0x00000000; + callback attribute packetUnicastTxCount default = 0x00000000; + callback attribute currentMaxRate default = 0x0000000000000000; + callback attribute overrunCount default = 0x0000000000000000; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_thermostat = 769, version 1; + + binding cluster Identify; + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + } + + server cluster Groups { + ram attribute nameSupport; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command AddGroup; + handle command AddGroupResponse; + handle command ViewGroup; + handle command ViewGroupResponse; + handle command GetGroupMembership; + handle command GetGroupMembershipResponse; + handle command RemoveGroup; + handle command RemoveGroupResponse; + handle command RemoveAllGroups; + handle command AddGroupIfIdentifying; + } + + server cluster Scenes { + callback attribute sceneCount default = 0x00; + ram attribute currentScene default = 0x00; + ram attribute currentGroup default = 0x0000; + ram attribute sceneValid default = 0x00; + ram attribute nameSupport; + ram attribute sceneTableSize; + callback attribute remainingCapacity; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command AddScene; + handle command AddSceneResponse; + handle command ViewScene; + handle command ViewSceneResponse; + handle command RemoveScene; + handle command RemoveSceneResponse; + handle command RemoveAllScenes; + handle command RemoveAllScenesResponse; + handle command StoreScene; + handle command StoreSceneResponse; + handle command RecallScene; + handle command GetSceneMembership; + handle command GetSceneMembershipResponse; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster PowerSource { + ram attribute status; + ram attribute order; + ram attribute description; + ram attribute wiredCurrentType; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster FixedLabel { + callback attribute labelList; + callback attribute eventList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster Thermostat { + ram attribute localTemperature; + ram attribute absMinHeatSetpointLimit default = 700; + ram attribute absMaxHeatSetpointLimit default = 3000; + ram attribute absMinCoolSetpointLimit default = 1600; + ram attribute absMaxCoolSetpointLimit default = 3200; + ram attribute HVACSystemTypeConfiguration; + persist attribute occupiedCoolingSetpoint default = 0x0A28; + persist attribute occupiedHeatingSetpoint default = 0x07D0; + ram attribute minHeatSetpointLimit default = 700; + ram attribute maxHeatSetpointLimit default = 3000; + ram attribute minCoolSetpointLimit default = 1600; + ram attribute maxCoolSetpointLimit default = 3200; + ram attribute minSetpointDeadBand default = 0x19; + ram attribute controlSequenceOfOperation default = 0x04; + persist attribute systemMode default = 0x01; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0x3; + ram attribute clusterRevision default = 5; + + handle command SetpointRaiseLower; + } +} + + diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap new file mode 100644 index 00000000000000..fcc14df85255d3 --- /dev/null +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -0,0 +1,4081 @@ +{ + "fileFormat": 2, + "featureLevel": 99, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "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": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-thermostat", + "deviceTypeRef": { + "code": 769, + "profileId": 259, + "label": "MA-thermostat", + "name": "MA-thermostat" + }, + "deviceTypes": [ + { + "code": 769, + "profileId": 259, + "label": "MA-thermostat", + "name": "MA-thermostat" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 769 + ], + "deviceTypeName": "MA-thermostat", + "deviceTypeCode": 769, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "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": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerSourceStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "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": "WiredCurrentType", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "WiredCurrentTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Thermostat", + "code": 513, + "mfgCode": null, + "define": "THERMOSTAT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetpointRaiseLower", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "LocalTemperature", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMinHeatSetpointLimit", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "700", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMaxHeatSetpointLimit", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMinCoolSetpointLimit", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1600", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AbsMaxCoolSetpointLimit", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3200", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HVACSystemTypeConfiguration", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupiedCoolingSetpoint", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A28", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupiedHeatingSetpoint", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x07D0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinHeatSetpointLimit", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "700", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxHeatSetpointLimit", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinCoolSetpointLimit", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1600", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MaxCoolSetpointLimit", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3200", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinSetpointDeadBand", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x19", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ControlSequenceOfOperation", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "ThermostatControlSequence", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x04", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SystemMode", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "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": 1, + "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": "0x3", + "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": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "MA-thermostat", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/thermostat/silabs/include/CHIPProjectConfig.h b/examples/thermostat/silabs/include/CHIPProjectConfig.h index 614361fb34e9f5..2e2f08628fa609 100644 --- a/examples/thermostat/silabs/include/CHIPProjectConfig.h +++ b/examples/thermostat/silabs/include/CHIPProjectConfig.h @@ -108,5 +108,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index b73e5866b03173..ca93b6b1fb2fd3 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -21,7 +21,7 @@ You can use this example as a reference for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 06f8bb14dddb33..be2a7be5dacc50 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ client cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -51,7 +51,7 @@ client cluster Identify = 3 { /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -60,11 +60,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -97,11 +97,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -115,7 +115,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -132,7 +132,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -143,7 +143,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -166,7 +166,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -204,7 +204,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -218,13 +218,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -232,7 +232,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -290,7 +290,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -314,7 +314,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -377,20 +377,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -451,13 +451,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -465,7 +465,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -529,7 +529,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -544,7 +544,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -559,12 +559,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -584,13 +584,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -605,7 +605,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -613,7 +613,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -669,7 +669,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -685,7 +685,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -694,13 +694,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -809,13 +817,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -823,7 +831,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -846,7 +854,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -856,7 +864,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -870,7 +878,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -878,14 +886,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -951,8 +959,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -983,19 +991,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1005,7 +1013,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1146,19 +1154,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1167,7 +1175,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1177,7 +1185,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1220,7 +1228,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1233,7 +1241,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1257,21 +1265,25 @@ server cluster EthernetNetworkDiagnostics = 55 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1284,7 +1296,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1298,12 +1310,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1345,7 +1357,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1353,14 +1365,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1383,12 +1395,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1399,7 +1411,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1414,12 +1426,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1519,13 +1531,13 @@ server cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ server cluster Thermostat = 513 { - enum SetpointAdjustMode : ENUM8 { + enum SetpointAdjustMode : enum8 { kHeat = 0; kCool = 1; kBoth = 2; } - enum ThermostatControlSequence : ENUM8 { + enum ThermostatControlSequence : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; kHeatingOnly = 2; @@ -1534,13 +1546,13 @@ server cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } - enum ThermostatRunningMode : ENUM8 { + enum ThermostatRunningMode : enum8 { kOff = 0; kCool = 3; kHeat = 4; } - enum ThermostatSystemMode : ENUM8 { + enum ThermostatSystemMode : enum8 { kOff = 0; kAuto = 1; kCool = 3; @@ -1552,7 +1564,7 @@ server cluster Thermostat = 513 { kSleep = 9; } - bitmap DayOfWeek : BITMAP8 { + bitmap DayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -1563,7 +1575,7 @@ server cluster Thermostat = 513 { kAway = 0x80; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHeating = 0x1; kCooling = 0x2; kOccupancy = 0x4; @@ -1573,7 +1585,7 @@ server cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; } - bitmap ModeForSequence : BITMAP8 { + bitmap ModeForSequence : bitmap8 { kHeatSetpointPresent = 0x1; kCoolSetpointPresent = 0x2; } diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index a3c65d1ebdf79e..74262e2093f6b1 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -3623,7 +3623,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5045,4 +5045,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 19516f50dc323b..5d7764d71f36c8 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -3,33 +3,33 @@ /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -48,23 +48,23 @@ server cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ server cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -156,7 +156,7 @@ server cluster LevelControl = 8 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -194,7 +194,7 @@ client cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -213,7 +213,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -227,13 +227,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -241,7 +241,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -299,7 +299,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -323,7 +323,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -386,20 +386,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ server cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -460,7 +460,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -475,7 +475,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -490,12 +490,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -515,13 +515,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -536,7 +536,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ client cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -544,7 +544,7 @@ client cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -603,7 +603,7 @@ client cluster GeneralCommissioning = 48 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -611,7 +611,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -667,7 +667,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ client cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -683,7 +683,7 @@ client cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -692,13 +692,21 @@ client cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -739,6 +747,9 @@ client cluster NetworkCommissioning = 49 { readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + readonly attribute optional int16u threadVersion = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -813,7 +824,7 @@ client cluster NetworkCommissioning = 49 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -829,7 +840,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -838,13 +849,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -953,13 +972,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -967,7 +986,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -990,7 +1009,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1000,7 +1019,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1014,7 +1033,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1022,14 +1041,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1095,8 +1114,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1127,19 +1146,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1149,7 +1168,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1288,19 +1307,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1309,7 +1328,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1319,7 +1338,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1360,7 +1379,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1373,7 +1392,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1394,26 +1413,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1426,7 +1449,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1440,12 +1463,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ client cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1487,12 +1510,12 @@ client cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } request struct CertificateChainRequestRequest { @@ -1500,11 +1523,11 @@ client cluster OperationalCredentials = 62 { } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } @@ -1514,9 +1537,9 @@ client cluster OperationalCredentials = 62 { } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1529,7 +1552,7 @@ client cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } request struct UpdateFabricLabelRequest { @@ -1564,12 +1587,12 @@ client cluster OperationalCredentials = 62 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1611,7 +1634,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1619,14 +1642,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1649,12 +1672,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1665,7 +1688,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1680,12 +1703,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1809,17 +1832,17 @@ server cluster WakeOnLan = 1283 { /** This cluster provides an interface for controlling the current Channel on a device. */ server cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -1874,7 +1897,7 @@ server cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ server cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -1909,7 +1932,7 @@ server cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ server cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -1918,14 +1941,14 @@ server cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -1981,7 +2004,7 @@ server cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ server cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -1996,15 +2019,15 @@ server cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -2028,7 +2051,7 @@ server cluster MediaInput = 1287 { command SelectInput(SelectInputRequest): DefaultSuccess = 0; command ShowInputStatus(): DefaultSuccess = 1; command HideInputStatus(): DefaultSuccess = 2; - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for managing low power mode on a device. */ @@ -2045,7 +2068,7 @@ server cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ server cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -2134,13 +2157,13 @@ server cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -2166,18 +2189,18 @@ server cluster KeypadInput = 1289 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -2194,12 +2217,12 @@ server cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -2272,7 +2295,7 @@ server cluster ContentLauncher = 1290 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ server cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -2281,14 +2304,14 @@ server cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; @@ -2310,18 +2333,18 @@ server cluster AudioOutput = 1291 { } command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ server cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -2369,7 +2392,7 @@ server cluster ApplicationLauncher = 1292 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ server cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -2383,12 +2406,12 @@ server cluster ApplicationBasic = 1293 { readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 82f970a56d21d2..58a0b469101460 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -3665,7 +3665,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -7340,7 +7340,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7621,5 +7621,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index 8a6212540be2f2..d7f41ac5b376c1 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -405,7 +405,7 @@ func initialize() -> MatterError { ### Discover Casting Players -_{Complete Discovery examples: [Linux](linux/simple-app.cpp)}_ +_{Complete Discovery examples: [Linux](linux/simple-app-helper.cpp)}_ The Casting Client discovers `CastingPlayers` using Matter Commissioner discovery over DNS-SD by listening for `CastingPlayer` events as they are @@ -444,12 +444,14 @@ singleton instance. Then, call `StartDiscovery` by optionally specifying the `kTargetPlayerDeviceType` to filter results by. ```c +const uint64_t kTargetPlayerDeviceType = 35; // 35 represents device type of Matter Video Player +... +... DiscoveryDelegateImpl delegate; CastingPlayerDiscovery::GetInstance()->SetDelegate(&delegate); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, ChipLogError(AppServer, "CastingPlayerDiscovery::SetDelegate failed %" CHIP_ERROR_FORMAT, err.Format())); -const uint64_t kTargetPlayerDeviceType = 35; // 35 represents device type of Matter Video Player err = CastingPlayerDiscovery::GetInstance()->StartDiscovery(kTargetPlayerDeviceType); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, ChipLogError(AppServer, "CastingPlayerDiscovery::StartDiscovery failed %" CHIP_ERROR_FORMAT, err.Format())); @@ -459,6 +461,35 @@ chip::DeviceLayer::PlatformMgr().RunEventLoop(); ### Connect to a Casting Player +_{Complete Connection examples: [Linux](linux/simple-app-helper.cpp)}_ + +Each `CastingPlayer` object created during +[Discovery](#discover-casting-players) contains information such as +`deviceName`, `vendorId`, `productId`, etc. which can help the user pick the +right `CastingPlayer`. A Casting Client can attempt to connect to the +`selectedCastingPlayer` using +[Matter User Directed Commissioning (UDC)](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/rendezvous/UserDirectedCommissioning.adoc). +The Matter TV Casting library locally caches information required to reconnect +to a `CastingPlayer`, once the Casting client has been commissioned by it. After +that, the Casting client is able to skip the full UDC process by establishing +CASE with the `CastingPlayer` directly. Once connected, the `CastingPlayer` +object will contain the list of available Endpoints on that `CastingPlayer`. + +On Linux, the Casting Client can connect to a `CastingPlayer` by successfully +calling `VerifyOrEstablishConnection` on it. + +```c +void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * castingPlayer) +{ + ChipLogProgress(AppServer, "ConnectionHandler called with %" CHIP_ERROR_FORMAT, err.Format()); +} + +... +// targetCastingPlayer is a discovered CastingPlayer +targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler); +... +``` + ### Select an Endpoint on the Casting Player ## Interacting with a Casting Endpoint diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java index 905dcb67f86bc8..1a9556e5fdb6d2 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java @@ -109,6 +109,7 @@ public void onDiscoveryStopped(String serviceType) { @Override public void onStartDiscoveryFailed(String serviceType, int errorCode) { Log.e(TAG, "Discovery failed to start: Error code:" + errorCode); + TvCastingApp.getInstance().resetDiscoveryState(); failureCallback.handle( new MatterError( 3, "NsdDiscoveryListener Discovery failed to start: Nsd Error code:" + errorCode)); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java index 253dbee0968874..638425675dc99b 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java @@ -143,13 +143,13 @@ private boolean isPassingDeviceTypeFilter(DiscoveredNodeData discoveredNodeData) private void addCommissioningInfo(DiscoveredNodeData discoveredNodeData) { if (preCommissionedVideoPlayers != null) { + long currentUnixTimeMS = System.currentTimeMillis(); for (VideoPlayer videoPlayer : preCommissionedVideoPlayers) { if (videoPlayer.isSameAs(discoveredNodeData)) { Log.d( TAG, "Matching Video Player with the following information found for DiscoveredNodeData" + videoPlayer); - long currentUnixTimeMS = System.currentTimeMillis(); Log.d(TAG, "Updating discovery timestamp for VideoPlayer to " + currentUnixTimeMS); videoPlayer.setLastDiscoveredMs(currentUnixTimeMS); discoveredNodeData.setConnectableVideoPlayer(videoPlayer); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java index a846ffcb7ee9a2..24852986768e7c 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java @@ -297,6 +297,17 @@ public void stopVideoPlayerDiscovery() { } } + void resetDiscoveryState() { + synchronized (discoveryLock) { + Log.d(TAG, "TvCastingApp resetting discovery state"); + this.discoveryStarted = false; + this.nsdDiscoveryListener = null; + if (multicastLock != null && multicastLock.isHeld()) { + multicastLock.release(); + } + } + } + public native boolean openBasicCommissioningWindow( int duration, CommissioningCallbacks commissioningCallbacks, diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp index f78c27c4b31383..dfcb2d8f44f69f 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp @@ -183,7 +183,7 @@ CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, Targe if (MACAddress != nullptr) { - chip::CharSpan MACAddressSpan(MACAddress, strlen(MACAddress) - 1); + chip::CharSpan MACAddressSpan(MACAddress, 2 * 2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength); outTargetVideoPlayerInfo.SetMACAddress(MACAddressSpan); } @@ -257,9 +257,9 @@ CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * ta jstring MACAddress = nullptr; if (targetVideoPlayerInfo->GetMACAddress() != nullptr && targetVideoPlayerInfo->GetMACAddress()->data() != nullptr) { - char MACAddressWithNil[2 * chip::DeviceLayer::ConfigurationManager::kMaxMACAddressLength + 1]; - strncpy(MACAddressWithNil, targetVideoPlayerInfo->GetMACAddress()->data(), - targetVideoPlayerInfo->GetMACAddress()->size()); + char MACAddressWithNil[2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength + 1]; + memcpy(MACAddressWithNil, targetVideoPlayerInfo->GetMACAddress()->data(), + targetVideoPlayerInfo->GetMACAddress()->size()); MACAddressWithNil[targetVideoPlayerInfo->GetMACAddress()->size()] = '\0'; MACAddress = env->NewStringUTF(MACAddressWithNil); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp index 984287af8c30fd..90a36bbfec92ca 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp @@ -21,7 +21,10 @@ #include "../JNIDACProvider.h" #include "../support/ErrorConverter-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" -#include "core/CastingApp.h" // from tv-casting-common + +// from tv-casting-common +#include "core/CastingApp.h" +#include "support/ChipDeviceEventHandler.h" #include #include @@ -79,20 +82,25 @@ JNI_METHOD(jobject, finishStartup)(JNIEnv *, jobject) { chip::DeviceLayer::StackLock lock; ChipLogProgress(AppServer, "JNI_METHOD CastingAppJNI.finishStartup called"); - auto & server = chip::Server::GetInstance(); + + CHIP_ERROR err = CHIP_NO_ERROR; + auto & server = chip::Server::GetInstance(); // TODO: Set AppDelegate // &server.GetCommissioningWindowManager().SetAppDelegate(??); // Initialize binding handlers - chip::BindingManager::GetInstance().Init( + err = chip::BindingManager::GetInstance().Init( { &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() }); + VerifyOrReturnValue(err == CHIP_NO_ERROR, support::createJMatterError(err), + ChipLogError(AppServer, "Failed to init BindingManager %" CHIP_ERROR_FORMAT, err.Format())); // TODO: Set FabricDelegate // chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&mPersistenceManager); - // TODO: Add DeviceEvent Handler - // ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(DeviceEventCallback, 0)); + err = chip::DeviceLayer::PlatformMgrImpl().AddEventHandler(support::ChipDeviceEventHandler::Handle, 0); + VerifyOrReturnValue(err == CHIP_NO_ERROR, support::createJMatterError(err), + ChipLogError(AppServer, "Failed to register ChipDeviceEventHandler %" CHIP_ERROR_FORMAT, err.Format())); return support::createJMatterError(CHIP_NO_ERROR); } diff --git a/examples/tv-casting-app/linux/BUILD.gn b/examples/tv-casting-app/linux/BUILD.gn index 113c6f56219f7d..0e4b9820538412 100644 --- a/examples/tv-casting-app/linux/BUILD.gn +++ b/examples/tv-casting-app/linux/BUILD.gn @@ -27,6 +27,8 @@ executable("chip-tv-casting-app") { if (chip_casting_simplified) { sources = [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h", + "simple-app-helper.cpp", + "simple-app-helper.h", "simple-app.cpp", ] } else { diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp new file mode 100644 index 00000000000000..dab134dfb7b57c --- /dev/null +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -0,0 +1,177 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "simple-app-helper.h" + +#include "app/clusters/bindings/BindingManager.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DiscoveryDelegateImpl * DiscoveryDelegateImpl::_discoveryDelegateImpl = nullptr; + +DiscoveryDelegateImpl * DiscoveryDelegateImpl::GetInstance() +{ + if (_discoveryDelegateImpl == nullptr) + { + _discoveryDelegateImpl = new DiscoveryDelegateImpl(); + } + return _discoveryDelegateImpl; +} + +void DiscoveryDelegateImpl::HandleOnAdded(matter::casting::memory::Strong player) +{ + if (commissionersCount == 0) + { + ChipLogProgress(AppServer, "Select discovered Casting Player (start index = 0) to request commissioning"); + + ChipLogProgress(AppServer, "Example: cast request 0"); + } + ChipLogProgress(AppServer, "Discovered CastingPlayer #%d", commissionersCount); + ++commissionersCount; + player->LogDetail(); +} + +void DiscoveryDelegateImpl::HandleOnUpdated(matter::casting::memory::Strong player) +{ + ChipLogProgress(AppServer, "Updated CastingPlayer with ID: %s", player->GetId()); +} + +void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * castingPlayer) +{ + ChipLogProgress(AppServer, "ConnectionHandler called with %" CHIP_ERROR_FORMAT, err.Format()); +} + +#if defined(ENABLE_CHIP_SHELL) +void RegisterCommands() +{ + static const chip::Shell::shell_command_t sDeviceComand = { &CommandHandler, "cast", + "Casting commands. Usage: cast [command_name]" }; + + // Register the root `device` command with the top-level shell. + chip::Shell::Engine::Root().RegisterCommands(&sDeviceComand, 1); +} + +CHIP_ERROR CommandHandler(int argc, char ** argv) +{ + if (argc == 0 || strcmp(argv[0], "help") == 0) + { + return PrintAllCommands(); + } + if (strcmp(argv[0], "discover") == 0) + { + ChipLogProgress(AppServer, "discover"); + + return matter::casting::core::CastingPlayerDiscovery::GetInstance()->StartDiscovery(kTargetPlayerDeviceType); + } + if (strcmp(argv[0], "stop-discovery") == 0) + { + ChipLogProgress(AppServer, "stop-discovery"); + return matter::casting::core::CastingPlayerDiscovery::GetInstance()->StopDiscovery(); + } + if (strcmp(argv[0], "request") == 0) + { + ChipLogProgress(AppServer, "request"); + if (argc < 2) + { + return PrintAllCommands(); + } + char * eptr; + unsigned long index = static_cast(strtol(argv[1], &eptr, 10)); + std::vector> castingPlayers = + matter::casting::core::CastingPlayerDiscovery::GetInstance()->GetCastingPlayers(); + VerifyOrReturnValue(0 <= index && index < castingPlayers.size(), CHIP_ERROR_INVALID_ARGUMENT, + ChipLogError(AppServer, "Invalid casting player index provided: %lu", index)); + std::shared_ptr targetCastingPlayer = castingPlayers.at(index); + targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler); + return CHIP_NO_ERROR; + } + if (strcmp(argv[0], "print-bindings") == 0) + { + PrintBindings(); + return CHIP_NO_ERROR; + } + if (strcmp(argv[0], "print-fabrics") == 0) + { + PrintFabrics(); + return CHIP_NO_ERROR; + } + if (strcmp(argv[0], "delete-fabric") == 0) + { + char * eptr; + chip::FabricIndex fabricIndex = (chip::FabricIndex) strtol(argv[1], &eptr, 10); + chip::Server::GetInstance().GetFabricTable().Delete(fabricIndex); + return CHIP_NO_ERROR; + } + return CHIP_ERROR_INVALID_ARGUMENT; +} + +CHIP_ERROR PrintAllCommands() +{ + chip::Shell::streamer_t * sout = chip::Shell::streamer_get(); + streamer_printf(sout, " help Usage: cast \r\n"); + streamer_printf(sout, " print-bindings Usage: cast print-bindings\r\n"); + streamer_printf(sout, " print-fabrics Usage: cast print-fabrics\r\n"); + streamer_printf( + sout, + " delete-fabric Delete a fabric from the casting client's fabric store. Usage: cast delete-fabric 1\r\n"); + streamer_printf(sout, " discover Discover Casting Players. Usage: cast discover\r\n"); + streamer_printf(sout, " stop-discovery Stop Discovery of Casting Players. Usage: cast stop-discovery\r\n"); + streamer_printf( + sout, " request Request connecting to discovered Casting Player with [index]. Usage: cast request 0\r\n"); + streamer_printf(sout, "\r\n"); + + return CHIP_NO_ERROR; +} + +void PrintBindings() +{ + for (const auto & binding : chip::BindingTable::GetInstance()) + { + ChipLogProgress(AppServer, + "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 + " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, + binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, + binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0))); + } +} + +void PrintFabrics() +{ + // set fabric to be the first in the list + for (const auto & fb : chip::Server::GetInstance().GetFabricTable()) + { + chip::FabricIndex fabricIndex = fb.GetFabricIndex(); + ChipLogError(AppServer, "Next Fabric index=%d", fabricIndex); + if (!fb.IsInitialized()) + { + ChipLogError(AppServer, " -- Not initialized"); + continue; + } + chip::NodeId myNodeId = fb.GetNodeId(); + ChipLogProgress(AppServer, + "---- Current Fabric nodeId=0x" ChipLogFormatX64 " fabricId=0x" ChipLogFormatX64 " fabricIndex=%d", + ChipLogValueX64(myNodeId), ChipLogValueX64(fb.GetFabricId()), fabricIndex); + } +} + +#endif // ENABLE_CHIP_SHELL diff --git a/examples/tv-casting-app/linux/simple-app-helper.h b/examples/tv-casting-app/linux/simple-app-helper.h new file mode 100644 index 00000000000000..d48b082e0faf30 --- /dev/null +++ b/examples/tv-casting-app/linux/simple-app-helper.h @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "core/CastingPlayer.h" +#include "core/CastingPlayerDiscovery.h" +#include "core/Types.h" + +#include + +/** + * @brief Matter deviceType that the Linux tv-casting-app will discover over Commissionable Node discovery (DNS-SD) + * + * 35 represents device type of Matter Video Player + */ +const uint64_t kTargetPlayerDeviceType = 35; + +/** + * @brief Singleton that reacts to CastingPlayer discovery results + */ +class DiscoveryDelegateImpl : public matter::casting::core::DiscoveryDelegate +{ +private: + DiscoveryDelegateImpl(){}; + static DiscoveryDelegateImpl * _discoveryDelegateImpl; + int commissionersCount = 0; + +public: + static DiscoveryDelegateImpl * GetInstance(); + + /** + * @brief Called when a new CastingPlayer is discovered + * + * @param player the discovered CastingPlayer + */ + void HandleOnAdded(matter::casting::memory::Strong player) override; + + /** + * @brief Called when there are updates to the Attributes of a previously discovered CastingPlayer + * + * @param player the updated CastingPlayer + */ + void HandleOnUpdated(matter::casting::memory::Strong player) override; +}; + +/** + * @brief Linux tv-casting-app's onCompleted handler for CastingPlayer.VerifyOrEstablishConnection API + */ +void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * castingPlayer); + +#if defined(ENABLE_CHIP_SHELL) +/** + * @brief Register CHIP Shell commands for the Linux tv-casting-app CLI + */ +void RegisterCommands(); + +/** + * @brief Top level handler that parses text entered on the Linux tv-casting-app CLI and invokes the appropriate handler + */ +CHIP_ERROR CommandHandler(int argc, char ** argv); + +/** + * @brief Prints all the commands available on the Linux tv-casting-app CLI + */ +CHIP_ERROR PrintAllCommands(); + +/** + * @brief Implements the "print-bindings" command + */ +void PrintBindings(); + +/** + * @brief Implements the "print-fabrics" command + */ +void PrintFabrics(); +#endif diff --git a/examples/tv-casting-app/linux/simple-app.cpp b/examples/tv-casting-app/linux/simple-app.cpp index cd2f71eb612159..d0a23769ea600b 100644 --- a/examples/tv-casting-app/linux/simple-app.cpp +++ b/examples/tv-casting-app/linux/simple-app.cpp @@ -16,6 +16,8 @@ * limitations under the License. */ +#include "simple-app-helper.h" + #include "core/CastingPlayer.h" #include "core/CastingPlayerDiscovery.h" #include "core/Types.h" @@ -31,6 +33,12 @@ #include #include +#if defined(ENABLE_CHIP_SHELL) +#include // nogncheck +#include +using chip::Shell::Engine; +#endif + using namespace matter::casting::core; using namespace matter::casting::support; @@ -78,33 +86,6 @@ CHIP_ERROR InitCommissionableDataProvider(LinuxCommissionableDataProvider & prov options.payload.discriminator.GetLongValue()); } -/** - * @brief React to discovery results - */ -class DiscoveryDelegateImpl : public DiscoveryDelegate -{ -private: - int commissionersCount = 0; - -public: - void HandleOnAdded(matter::casting::memory::Strong player) override - { - if (commissionersCount == 0) - { - ChipLogProgress(AppServer, "Select discovered CastingPlayer to request commissioning"); - - ChipLogProgress(AppServer, "Example: cast request 0"); - } - ++commissionersCount; - ChipLogProgress(AppServer, "Discovered CastingPlayer #%d", commissionersCount); - player->LogDetail(); - } - void HandleOnUpdated(matter::casting::memory::Strong player) override - { - ChipLogProgress(AppServer, "Updated CastingPlayer with ID: %s", player->GetId()); - } -}; - /** * @brief Provides the unique ID that is used by the SDK to generate the Rotating Device ID. */ @@ -177,14 +158,18 @@ int main(int argc, char * argv[]) VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, ChipLogError(AppServer, "CastingApp::Start failed %" CHIP_ERROR_FORMAT, err.Format())); - DiscoveryDelegateImpl delegate; - CastingPlayerDiscovery::GetInstance()->SetDelegate(&delegate); +#if defined(ENABLE_CHIP_SHELL) + chip::Shell::Engine::Root().Init(); + std::thread shellThread([]() { chip::Shell::Engine::Root().RunMainLoop(); }); + RegisterCommands(); +#endif + + CastingPlayerDiscovery::GetInstance()->SetDelegate(DiscoveryDelegateImpl::GetInstance()); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, ChipLogError(AppServer, "CastingPlayerDiscovery::SetDelegate failed %" CHIP_ERROR_FORMAT, err.Format())); // Discover CastingPlayers - const uint64_t kTargetPlayerDeviceType = 35; // 35 represents device type of Matter Video Player - err = CastingPlayerDiscovery::GetInstance()->StartDiscovery(kTargetPlayerDeviceType); + err = CastingPlayerDiscovery::GetInstance()->StartDiscovery(kTargetPlayerDeviceType); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, ChipLogError(AppServer, "CastingPlayerDiscovery::StartDiscovery failed %" CHIP_ERROR_FORMAT, err.Format())); diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index ece67da9e6cc82..4e87c59f118a99 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -95,11 +95,16 @@ chip_data_model("tv-casting-common") { sources += [ "core/CastingApp.cpp", "core/CastingApp.h", + "core/CastingPlayer.cpp", "core/CastingPlayer.h", "core/CastingPlayerDiscovery.cpp", "core/CastingPlayerDiscovery.h", "core/Types.h", "support/AppParameters.h", + "support/CastingStore.cpp", + "support/CastingStore.h", + "support/ChipDeviceEventHandler.cpp", + "support/ChipDeviceEventHandler.h", "support/DataProvider.h", ] diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp index bc495a27fff870..45f0efdc913e47 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp @@ -18,6 +18,8 @@ #include "CastingApp.h" +#include "support/ChipDeviceEventHandler.h" + #include #include #include @@ -109,8 +111,8 @@ CHIP_ERROR CastingApp::PostStartRegistrations() // TODO: Set FabricDelegate // chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&mPersistenceManager); - // TODO: Add DeviceEvent Handler - // ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(DeviceEventCallback, 0)); + // Register DeviceEvent Handler + ReturnErrorOnFailure(chip::DeviceLayer::PlatformMgrImpl().AddEventHandler(ChipDeviceEventHandler::Handle, 0)); mState = CASTING_APP_RUNNING; // CastingApp started successfully, set state to RUNNING return CHIP_NO_ERROR; diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.h b/examples/tv-casting-app/tv-casting-common/core/CastingApp.h index 25312daaa4cecf..84bff301dfb1cf 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.h @@ -67,6 +67,11 @@ class CastingApp */ CHIP_ERROR Stop(); + /** + * @return true, if CastingApp is in CASTING_APP_RUNNING state. false otherwise + */ + bool isRunning() { return mState == CASTING_APP_RUNNING; } + private: CastingApp(); static CastingApp * _castingApp; diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp new file mode 100644 index 00000000000000..9cc11a774e1564 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp @@ -0,0 +1,275 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CastingPlayer.h" +#include "support/CastingStore.h" + +#include + +namespace matter { +namespace casting { +namespace core { + +CastingPlayer * CastingPlayer::mTargetCastingPlayer = nullptr; + +void CastingPlayer::VerifyOrEstablishConnection(ConnectCallback onCompleted, unsigned long long int commissioningWindowTimeoutSec) +{ + ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection called"); + + std::vector::iterator it; + std::vector cachedCastingPlayers = support::CastingStore::GetInstance()->ReadAll(); + + CHIP_ERROR err = CHIP_NO_ERROR; + + // ensure the app was not already in the process of connecting to this CastingPlayer + err = (mConnectionState != CASTING_PLAYER_CONNECTING ? CHIP_NO_ERROR : CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(mConnectionState != CASTING_PLAYER_CONNECTING, + ChipLogError(AppServer, + "CastingPlayer::VerifyOrEstablishConnection called while already connecting to this CastingPlayer")); + mConnectionState = CASTING_PLAYER_CONNECTING; + mOnCompleted = onCompleted; + mCommissioningWindowTimeoutSec = commissioningWindowTimeoutSec; + mTargetCastingPlayer = this; + + // If this CastingPlayer is the cache of CastingPlayers the app previously connected to (and has nodeId and fabricIndex of), + // simply Find or Re-establish the CASE session and return early + if (cachedCastingPlayers.size() != 0) + { + it = std::find_if(cachedCastingPlayers.begin(), cachedCastingPlayers.end(), + [this](const core::CastingPlayer & castingPlayerParam) { return castingPlayerParam == *this; }); + + if (it != cachedCastingPlayers.end()) + { + unsigned index = (unsigned int) std::distance(cachedCastingPlayers.begin(), it); + *this = cachedCastingPlayers[index]; + + FindOrEstablishSession( + nullptr, + [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { + ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer successful"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_CONNECTED; + support::CastingStore::GetInstance()->AddOrUpdate(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); + }, + [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { + ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer failed"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + support::CastingStore::GetInstance()->Delete(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(error, nullptr); + mTargetCastingPlayer = nullptr; + }); + return; // FindOrEstablishSession called. Return early. + } + } + + // this CastingPlayer is not in the list of cached CastingPlayers previously connected to. This VerifyOrEstablishConnection call + // will require User Directed Commissioning. + if (chip::Server::GetInstance().GetFailSafeContext().IsFailSafeArmed()) + { + ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection Forcing expiry of armed FailSafe timer"); + // ChipDeviceEventHandler will handle the kFailSafeTimerExpired event by Opening the Basic Commissioning Window and Sending + // the User Directed Commissioning Request + chip::Server::GetInstance().GetFailSafeContext().ForceFailSafeTimerExpiry(); + } + else + { + SuccessOrExit(err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow( + chip::System::Clock::Seconds16(mCommissioningWindowTimeoutSec))); + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + SuccessOrExit(err = SendUserDirectedCommissioningRequest()); +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + } + +exit: + if (err != CHIP_NO_ERROR) + { + support::ChipDeviceEventHandler::SetUdcStatus(false); + mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + mCommissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec; + mOnCompleted = nullptr; + mTargetCastingPlayer = nullptr; + ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection failed with %" CHIP_ERROR_FORMAT, err.Format()); + mOnCompleted(err, nullptr); + } +} + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT +CHIP_ERROR CastingPlayer::SendUserDirectedCommissioningRequest() +{ + chip::Inet::IPAddress * ipAddressToUse = GetIpAddressForUDCRequest(); + VerifyOrReturnValue(ipAddressToUse != nullptr, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "No IP Address found to send UDC request to")); + + ReturnErrorOnFailure(chip::Server::GetInstance().SendUserDirectedCommissioningRequest( + chip::Transport::PeerAddress::UDP(*ipAddressToUse, mAttributes.port, mAttributes.interfaceId))); + + ReturnErrorOnFailure(support::ChipDeviceEventHandler::SetUdcStatus(true)); + + return CHIP_NO_ERROR; +} + +chip::Inet::IPAddress * CastingPlayer::GetIpAddressForUDCRequest() +{ + size_t ipIndexToUse = 0; + for (size_t i = 0; i < mAttributes.numIPs; i++) + { + if (mAttributes.ipAddresses[i].IsIPv4()) + { + ipIndexToUse = i; + ChipLogProgress(AppServer, "Found IPv4 address at index: %lu - prioritizing use of IPv4", + static_cast(ipIndexToUse)); + break; + } + + if (i == (mAttributes.numIPs - 1)) + { + ChipLogProgress(AppServer, "Could not find an IPv4 address, defaulting to the first address in IP list"); + } + } + + return &mAttributes.ipAddresses[ipIndexToUse]; +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + +void CastingPlayer::FindOrEstablishSession(void * clientContext, chip::OnDeviceConnected onDeviceConnected, + chip::OnDeviceConnectionFailure onDeviceConnectionFailure) +{ + ChipLogProgress(AppServer, "CastingPlayer.FindOrEstablishSession called on nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", + ChipLogValueX64(mAttributes.nodeId), mAttributes.fabricIndex); + VerifyOrReturn(mAttributes.nodeId != 0 && mAttributes.fabricIndex != 0, + ChipLogError(AppServer, "CastingPlayer.FindOrEstablishSession called on invalid nodeId/fabricIndex")); + + ConnectionContext * connectionContext = + new ConnectionContext(clientContext, this, onDeviceConnected, onDeviceConnectionFailure); + + chip::Server::GetInstance().GetCASESessionManager()->FindOrEstablishSession( + chip::ScopedNodeId(mAttributes.nodeId, mAttributes.fabricIndex), connectionContext->mOnConnectedCallback, + connectionContext->mOnConnectionFailureCallback); +} + +void CastingPlayer::LogDetail() const +{ + if (strlen(mAttributes.id) != 0) + { + ChipLogDetail(AppServer, "\tID: %s", mAttributes.id); + } + if (strlen(mAttributes.deviceName) != 0) + { + ChipLogDetail(AppServer, "\tName: %s", mAttributes.deviceName); + } + if (strlen(mAttributes.hostName) != 0) + { + ChipLogDetail(AppServer, "\tHost Name: %s", mAttributes.hostName); + } + if (strlen(mAttributes.instanceName) != 0) + { + ChipLogDetail(AppServer, "\tInstance Name: %s", mAttributes.instanceName); + } + if (mAttributes.numIPs > 0) + { + ChipLogDetail(AppServer, "\tNumber of IPs: %u", mAttributes.numIPs); + } + char buf[chip::Inet::IPAddress::kMaxStringLength]; + if (strlen(mAttributes.ipAddresses[0].ToString(buf)) != 0) + { + for (unsigned j = 0; j < mAttributes.numIPs; j++) + { + char * ipAddressOut = mAttributes.ipAddresses[j].ToString(buf); + ChipLogDetail(AppServer, "\tIP Address #%d: %s", j + 1, ipAddressOut); + } + } + if (mAttributes.port > 0) + { + ChipLogDetail(AppServer, "\tPort: %u", mAttributes.port); + } + if (mAttributes.productId > 0) + { + ChipLogDetail(AppServer, "\tProduct ID: %u", mAttributes.productId); + } + if (mAttributes.vendorId > 0) + { + ChipLogDetail(AppServer, "\tVendor ID: %u", mAttributes.vendorId); + } + if (mAttributes.deviceType > 0) + { + ChipLogDetail(AppServer, "\tDevice Type: %" PRIu32, mAttributes.deviceType); + } + if (mAttributes.nodeId > 0) + { + ChipLogDetail(AppServer, "\tNode ID: 0x" ChipLogFormatX64, ChipLogValueX64(mAttributes.nodeId)); + } + if (mAttributes.fabricIndex > 0) + { + ChipLogDetail(AppServer, "\tFabric Index: %u", mAttributes.fabricIndex); + } +} + +ConnectionContext::ConnectionContext(void * clientContext, core::CastingPlayer * targetCastingPlayer, + chip::OnDeviceConnected onDeviceConnectedFn, + chip::OnDeviceConnectionFailure onDeviceConnectionFailureFn) +{ + mClientContext = clientContext; + mTargetCastingPlayer = targetCastingPlayer; + mOnDeviceConnectedFn = onDeviceConnectedFn; + mOnDeviceConnectionFailureFn = onDeviceConnectionFailureFn; + + mOnConnectedCallback = new chip::Callback::Callback( + [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { + ChipLogProgress(AppServer, "Device Connection success callback called"); + ConnectionContext * connectionContext = static_cast(context); + VerifyOrReturn(connectionContext != nullptr && connectionContext->mTargetCastingPlayer != nullptr, + ChipLogError(AppServer, "Invalid ConnectionContext received in DeviceConnection success callback")); + + connectionContext->mTargetCastingPlayer->mConnectionState = core::CASTING_PLAYER_CONNECTED; + connectionContext->mOnDeviceConnectedFn(context, exchangeMgr, sessionHandle); + delete connectionContext; + }, + this); + + mOnConnectionFailureCallback = new chip::Callback::Callback( + [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { + ChipLogError(AppServer, "Device Connection failure callback called with %" CHIP_ERROR_FORMAT, error.Format()); + ConnectionContext * connectionContext = static_cast(context); + VerifyOrReturn(connectionContext != nullptr && connectionContext->mTargetCastingPlayer != nullptr, + ChipLogError(AppServer, "Invalid ConnectionContext received in DeviceConnection failure callback")); + connectionContext->mTargetCastingPlayer->mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + connectionContext->mOnDeviceConnectionFailureFn(connectionContext->mClientContext, peerId, error); + delete connectionContext; + }, + this); +} + +ConnectionContext::~ConnectionContext() +{ + if (mOnConnectedCallback != nullptr) + { + delete mOnConnectedCallback; + } + + if (mOnConnectionFailureCallback != nullptr) + { + delete mOnConnectionFailureCallback; + } +} + +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h index 977642790e60e6..17d722d6dc5210 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h @@ -19,8 +19,9 @@ #pragma once #include "Types.h" -#include "lib/support/logging/CHIPLogging.h" +#include "support/ChipDeviceEventHandler.h" +#include "lib/support/logging/CHIPLogging.h" #include #include #include @@ -30,47 +31,87 @@ namespace matter { namespace casting { namespace core { -enum ConnectionError -{ - NO_CONNECTION_ERROR = 0, - FAILED_TO_CONNECT = 1 -}; - -using ConnectCallback = std::function; -using DisconnectCallback = std::function; - const int kPortMaxLength = 5; // port is uint16_t // +1 for the : between the hostname and the port. -const int kIdMaxLength = chip::Dnssd::kHostNameMaxLength + kPortMaxLength + 1; +const int kIdMaxLength = chip::Dnssd::kHostNameMaxLength + kPortMaxLength + 1; +const unsigned long long int kCommissioningWindowTimeoutSec = 3 * 60; // 3 minutes class CastingPlayerAttributes { public: - char id[kIdMaxLength + 1] = {}; - char deviceName[chip::Dnssd::kMaxDeviceNameLen + 1] = {}; - char hostName[chip::Dnssd::kHostNameMaxLength + 1] = {}; - char instanceName[chip::Dnssd::kHostNameMaxLength + 1] = {}; + char id[kIdMaxLength + 1] = {}; + char deviceName[chip::Dnssd::kMaxDeviceNameLen + 1] = {}; + char hostName[chip::Dnssd::kHostNameMaxLength + 1] = {}; + char instanceName[chip::Dnssd::Commission::kInstanceNameMaxLength + 1] = {}; unsigned int numIPs; // number of valid IP addresses chip::Inet::IPAddress ipAddresses[chip::Dnssd::CommonResolutionData::kMaxIPAddresses]; + chip::Inet::InterfaceId interfaceId; uint16_t port; uint16_t productId; uint16_t vendorId; uint32_t deviceType; + + chip::NodeId nodeId = 0; + chip::FabricIndex fabricIndex = 0; +}; + +/** + * @brief Represents CastingPlayer ConnectionState. + * + */ +enum ConnectionState +{ + CASTING_PLAYER_NOT_CONNECTED, + CASTING_PLAYER_CONNECTING, + CASTING_PLAYER_CONNECTED, }; +class ConnectionContext; +class CastingPlayer; +using ConnectCallback = std::function; + /** * @brief CastingPlayer represents a Matter commissioner that is able to play media to a physical * output or to a display screen which is part of the device. */ class CastingPlayer : public std::enable_shared_from_this { -private: - // std::vector> endpoints; - bool mConnected = false; - CastingPlayerAttributes mAttributes; - public: CastingPlayer(CastingPlayerAttributes playerAttributes) { mAttributes = playerAttributes; } + + /** + * @brief Get the CastingPlayer object targeted currently (may not be connected) + */ + static CastingPlayer * GetTargetCastingPlayer() { return mTargetCastingPlayer; } + + /** + * @brief Compares based on the Id + */ + bool operator==(const CastingPlayer & other) const + { + int compareResult = strcmp(this->mAttributes.id, other.mAttributes.id); + return (compareResult == 0) ? 1 : 0; + } + + /** + * @return true if this CastingPlayer is connected to the CastingApp + */ + bool IsConnected() const { return mConnectionState == CASTING_PLAYER_CONNECTED; } + + /** + * @brief Verifies that a connection exists with this CastingPlayer, or triggers a new session + * request. If the CastingApp does not have the nodeId and fabricIndex of this CastingPlayer cached on disk, + * this will execute the user directed commissioning process. + * + * @param onCompleted for success - called back with CHIP_NO_ERROR and CastingPlayer *. + * For failure - called back with an error and nullptr. + * @param commissioningWindowTimeoutSec time (in sec) to keep the commissioning window open, if commissioning is required. + * Defaults to kCommissioningWindowTimeoutSec. + */ + void VerifyOrEstablishConnection(ConnectCallback onCompleted, + unsigned long long int commissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec); + void LogDetail() const; + const char * GetId() const { return mAttributes.id; } const char * GetDeviceName() const { return mAttributes.deviceName; } @@ -91,77 +132,77 @@ class CastingPlayer : public std::enable_shared_from_this uint32_t GetDeviceType() const { return mAttributes.deviceType; } - // public: + chip::NodeId GetNodeId() const { return mAttributes.nodeId; } + + chip::FabricIndex GetFabricIndex() const { return mAttributes.fabricIndex; } + + void SetNodeId(chip::NodeId nodeId) { mAttributes.nodeId = nodeId; } + + void SetFabricIndex(chip::FabricIndex fabricIndex) { mAttributes.fabricIndex = fabricIndex; } + // void RegisterEndpoint(const memory::Strong endpoint) { endpoints.push_back(endpoint); } // const std::vector> GetEndpoints() const { return endpoints; } +private: + // std::vector> endpoints; + ConnectionState mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + CastingPlayerAttributes mAttributes; + static CastingPlayer * mTargetCastingPlayer; + unsigned long long int mCommissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec; + ConnectCallback mOnCompleted = {}; + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT /** - * @brief Compares based on the Id + * @brief Sends the user directed commissioning request to this CastingPlayer */ - bool operator==(const CastingPlayer & other) const - { - int compareResult = strcmp(this->mAttributes.id, other.mAttributes.id); - return (compareResult == 0) ? 1 : 0; - } + CHIP_ERROR SendUserDirectedCommissioningRequest(); -public: /** - * @return true if this CastingPlayer is connected to the CastingApp + * @brief Selects an IP Address to send the UDC request to. + * Prioritizes IPV4 addresses over IPV6. + * + * @return chip::Inet::IPAddress* */ - bool IsConnected() const { return mConnected; } + chip::Inet::IPAddress * GetIpAddressForUDCRequest(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT - void Connect(const long timeout, ConnectCallback onCompleted); - void Disconnect(const long timeout, DisconnectCallback onCompleted); + /** + * @brief Find an existing session for this CastingPlayer, or trigger a new session + * request. + * + * The caller can optionally provide `onDeviceConnected` and `onDeviceConnectionFailure` callback + * objects. If provided, these will be used to inform the caller about + * successful or failed connection establishment. + * + * If the connection is already established, the `onDeviceConnected` callback + * will be immediately called, before FindOrEstablishSession returns. + * + * The `onDeviceConnectionFailure` callback may be called before the FindOrEstablishSession + * call returns, for error cases that are detected synchronously. + */ + void FindOrEstablishSession(void * clientContext, chip::OnDeviceConnected onDeviceConnected, + chip::OnDeviceConnectionFailure onDeviceConnectionFailure); - void LogDetail() const - { - if (strlen(mAttributes.id) != 0) - { - ChipLogDetail(Discovery, "\tID: %s", mAttributes.id); - } - if (strlen(mAttributes.deviceName) != 0) - { - ChipLogDetail(Discovery, "\tName: %s", mAttributes.deviceName); - } - if (strlen(mAttributes.hostName) != 0) - { - ChipLogDetail(Discovery, "\tHost Name: %s", mAttributes.hostName); - } - if (strlen(mAttributes.instanceName) != 0) - { - ChipLogDetail(Discovery, "\tInstance Name: %s", mAttributes.instanceName); - } - if (mAttributes.numIPs > 0) - { - ChipLogDetail(Discovery, "\tNumber of IPs: %u", mAttributes.numIPs); - } - char buf[chip::Inet::IPAddress::kMaxStringLength]; - if (strlen(mAttributes.ipAddresses[0].ToString(buf)) != 0) - { - for (unsigned j = 0; j < mAttributes.numIPs; j++) - { - char * ipAddressOut = mAttributes.ipAddresses[j].ToString(buf); - ChipLogDetail(AppServer, "\tIP Address #%d: %s", j + 1, ipAddressOut); - } - } - if (mAttributes.port > 0) - { - ChipLogDetail(Discovery, "\tPort: %u", mAttributes.port); - } - if (mAttributes.productId > 0) - { - ChipLogDetail(Discovery, "\tProduct ID: %u", mAttributes.productId); - } - if (mAttributes.vendorId > 0) - { - ChipLogDetail(Discovery, "\tVendor ID: %u", mAttributes.vendorId); - } - if (mAttributes.deviceType > 0) - { - ChipLogDetail(Discovery, "\tDevice Type: %" PRIu32, mAttributes.deviceType); - } - } + // ChipDeviceEventHandler handles chip::DeviceLayer::ChipDeviceEvent events and helps the CastingPlayer class commission with + // and connect to a CastingPlayer + friend class support::ChipDeviceEventHandler; + friend class ConnectionContext; +}; + +class ConnectionContext +{ +public: + ConnectionContext(void * clientContext, core::CastingPlayer * targetCastingPlayer, chip::OnDeviceConnected onDeviceConnected, + chip::OnDeviceConnectionFailure onDeviceConnectionFailure); + ~ConnectionContext(); + + void * mClientContext = nullptr; + core::CastingPlayer * mTargetCastingPlayer = nullptr; + chip::OnDeviceConnected mOnDeviceConnectedFn = nullptr; + chip::OnDeviceConnectionFailure mOnDeviceConnectionFailureFn = nullptr; + chip::Callback::Callback * mOnConnectedCallback = nullptr; + chip::Callback::Callback * mOnConnectionFailureCallback = nullptr; }; }; // namespace core diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp index e391116c0ef1f7..27bbe9bc14204b 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayerDiscovery.cpp @@ -79,24 +79,23 @@ void DeviceDiscoveryDelegateImpl::OnDiscoveredDevice(const chip::Dnssd::Discover // convert nodeData to CastingPlayer CastingPlayerAttributes attributes; - strcpy(attributes.id, nodeData.resolutionData.hostName); + snprintf(attributes.id, kIdMaxLength + 1, "%s%u", nodeData.resolutionData.hostName, nodeData.resolutionData.port); - char port[kPortMaxLength + 1] = {}; - snprintf(port, sizeof(port), "%u", nodeData.resolutionData.port); - strcat(attributes.id, port); + chip::Platform::CopyString(attributes.deviceName, chip::Dnssd::kMaxDeviceNameLen + 1, nodeData.commissionData.deviceName); + chip::Platform::CopyString(attributes.hostName, chip::Dnssd::kHostNameMaxLength + 1, nodeData.resolutionData.hostName); + chip::Platform::CopyString(attributes.instanceName, chip::Dnssd::Commission::kInstanceNameMaxLength + 1, + nodeData.commissionData.instanceName); - strcpy(attributes.deviceName, nodeData.commissionData.deviceName); - strcpy(attributes.hostName, nodeData.resolutionData.hostName); - strcpy(attributes.instanceName, nodeData.commissionData.instanceName); attributes.numIPs = (unsigned int) nodeData.resolutionData.numIPs; for (unsigned j = 0; j < attributes.numIPs; j++) { attributes.ipAddresses[j] = nodeData.resolutionData.ipAddress[j]; } - attributes.port = nodeData.resolutionData.port; - attributes.productId = nodeData.commissionData.productId; - attributes.vendorId = nodeData.commissionData.vendorId; - attributes.deviceType = nodeData.commissionData.deviceType; + attributes.interfaceId = nodeData.resolutionData.interfaceId; + attributes.port = nodeData.resolutionData.port; + attributes.productId = nodeData.commissionData.productId; + attributes.vendorId = nodeData.commissionData.vendorId; + attributes.deviceType = nodeData.commissionData.deviceType; memory::Strong player = std::make_shared(attributes); diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h index b2086368467513..8c00cf61da4031 100644 --- a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h +++ b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h @@ -95,8 +95,8 @@ class TargetVideoPlayerInfo bool IsAsleep() { return mIsAsleep; } void SetMACAddress(chip::CharSpan MACAddress) { - memcpy(mMACAddressBuf, MACAddress.data(), MACAddress.size()); - mMACAddress = chip::CharSpan(mMACAddressBuf, MACAddress.size()); + memcpy(mMACAddressBuf, MACAddress.data(), sizeof(mMACAddressBuf)); + mMACAddress = chip::CharSpan(mMACAddressBuf, sizeof(mMACAddressBuf)); } chip::System::Clock::Timestamp GetLastDiscovered() { return mLastDiscovered; } void SetLastDiscovered(chip::System::Clock::Timestamp lastDiscovered) { mLastDiscovered = lastDiscovered; } @@ -106,7 +106,7 @@ class TargetVideoPlayerInfo // it was recently discoverable if its mLastDiscovered.count is within // CHIP_DEVICE_CONFIG_STR_CACHE_LAST_DISCOVERED_HOURS of current time chip::System::Clock::Timestamp currentUnixTimeMS = chip::System::Clock::kZero; - chip::System::SystemClock().GetClock_RealTimeMS(currentUnixTimeMS); + VerifyOrReturnValue(chip::System::SystemClock().GetClock_RealTimeMS(currentUnixTimeMS) == CHIP_NO_ERROR, true); ChipLogProgress(AppServer, "WasRecentlyDiscoverable currentUnixTimeMS: %lu mLastDiscovered: %lu", static_cast(currentUnixTimeMS.count()), static_cast(mLastDiscovered.count())); return mLastDiscovered.count() > @@ -211,7 +211,7 @@ class TargetVideoPlayerInfo char mInstanceName[chip::Dnssd::Commission::kInstanceNameMaxLength + 1]; uint16_t mPort; chip::CharSpan mMACAddress; - char mMACAddressBuf[2 * chip::DeviceLayer::ConfigurationManager::kMaxMACAddressLength]; + char mMACAddressBuf[2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength]; chip::System::Clock::Timestamp mLastDiscovered; bool mIsAsleep = false; bool mInitialized = false; diff --git a/examples/tv-casting-app/tv-casting-common/src/PersistenceManager.cpp b/examples/tv-casting-app/tv-casting-common/src/PersistenceManager.cpp index 32b6eae3714597..8d2db13d95b292 100644 --- a/examples/tv-casting-app/tv-casting-common/src/PersistenceManager.cpp +++ b/examples/tv-casting-app/tv-casting-common/src/PersistenceManager.cpp @@ -267,11 +267,11 @@ CHIP_ERROR PersistenceManager::ReadAllVideoPlayers(TargetVideoPlayerInfo outVide char hostName[chip::Dnssd::kHostNameMaxLength + 1] = {}; size_t numIPs = 0; Inet::IPAddress ipAddress[chip::Dnssd::CommonResolutionData::kMaxIPAddresses]; - uint64_t lastDiscoveredMs = 0; - char MACAddressBuf[2 * chip::DeviceLayer::ConfigurationManager::kMaxMACAddressLength] = {}; - uint32_t MACAddressLength = 0; - char instanceName[chip::Dnssd::Commission::kInstanceNameMaxLength + 1] = {}; - uint16_t port = 0; + uint64_t lastDiscoveredMs = 0; + char MACAddressBuf[2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength] = {}; + uint32_t MACAddressLength = 0; + char instanceName[chip::Dnssd::Commission::kInstanceNameMaxLength + 1] = {}; + uint16_t port = 0; CHIP_ERROR err; while ((err = reader.Next()) == CHIP_NO_ERROR) @@ -349,7 +349,7 @@ CHIP_ERROR PersistenceManager::ReadAllVideoPlayers(TargetVideoPlayerInfo outVide { MACAddressLength = reader.GetLength(); ReturnErrorOnFailure(reader.GetBytes(reinterpret_cast(MACAddressBuf), - 2 * chip::DeviceLayer::ConfigurationManager::kMaxMACAddressLength)); + 2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength)); continue; } diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp new file mode 100644 index 00000000000000..1bfd75a93a47ca --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp @@ -0,0 +1,344 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CastingStore.h" + +#include +#include + +namespace matter { +namespace casting { +namespace support { + +CastingStore * CastingStore::_CastingStore = nullptr; + +CastingStore::CastingStore() {} + +CastingStore * CastingStore::GetInstance() +{ + if (_CastingStore == nullptr) + { + _CastingStore = new CastingStore(); + } + return _CastingStore; +} + +CHIP_ERROR CastingStore::AddOrUpdate(core::CastingPlayer castingPlayer) +{ + ChipLogProgress(AppServer, "CastingStore::AddOrUpdate"); + + // Read cache of CastingPlayers + std::vector castingPlayers = ReadAll(); + + // search for castingPlayer in CastingStore cache and overwrite it, if found + if (castingPlayers.size() != 0) + { + auto it = std::find_if( + castingPlayers.begin(), castingPlayers.end(), + [castingPlayer](const core::CastingPlayer & castingPlayerParam) { return castingPlayerParam == castingPlayer; }); + + if (it != castingPlayers.end()) + { + unsigned index = (unsigned int) std::distance(castingPlayers.begin(), it); + castingPlayers[index] = castingPlayer; + ChipLogProgress(AppServer, "CastingStore::AddOrUpdate updating CastingPlayer in CastingStore cache"); + return WriteAll(castingPlayers); // return early + } + } + + // add *new* castingPlayer to CastingStore cache + castingPlayers.push_back(castingPlayer); + ChipLogProgress(AppServer, "CastingStore::AddOrUpdate adding new CastingPlayer in CastingStore cache"); + return WriteAll(castingPlayers); +} + +std::vector CastingStore::ReadAll() +{ + ChipLogProgress(AppServer, "CastingStore::ReadAll called"); + CHIP_ERROR err = CHIP_NO_ERROR; + + std::vector castingPlayers; + uint8_t castingStoreData[kCastingStoreDataMaxBytes]; + size_t castingStoreDataSize = 0; + err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Get(kCastingStoreDataKey, castingStoreData, + kCastingStoreDataMaxBytes, &castingStoreDataSize); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "KeyValueStoreMgr.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + ChipLogProgress(AppServer, "CastingStore::ReadAll Read TLV(CastingStoreData) from KVS store with size: %lu bytes", + static_cast(castingStoreDataSize)); + + chip::TLV::TLVReader reader; + reader.Init(castingStoreData); + + // read the envelope (and version) + err = reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Next failed %" CHIP_ERROR_FORMAT, err.Format())); + + chip::TLV::TLVType outerContainerType = chip::TLV::kTLVType_Structure; + err = reader.EnterContainer(outerContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + err = reader.Next(); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Next failed %" CHIP_ERROR_FORMAT, err.Format())); + chip::TLV::Tag outerContainerTag = reader.GetTag(); + uint8_t outerContainerTagTagNum = static_cast(chip::TLV::TagNumFromTag(outerContainerTag)); + VerifyOrReturnValue(outerContainerTagTagNum == kCastingStoreDataVersionTag, castingPlayers, + ChipLogError(AppServer, "CastingStoreDataVersionTag not found")); + uint32_t version; + err = reader.Get(version); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + ChipLogProgress(AppServer, "CastingStore::ReadAll TLV(CastingStoreData) version: %d", version); + + // Entering CastingPlayers container + chip::TLV::TLVType castingPlayersContainerType = chip::TLV::kTLVType_Array; + err = reader.Next(); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Next failed %" CHIP_ERROR_FORMAT, err.Format())); + err = reader.EnterContainer(castingPlayersContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + // Entering CastingPlayer container + chip::TLV::TLVType castingPlayerContainerType = chip::TLV::kTLVType_Structure; + err = reader.EnterContainer(castingPlayerContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + core::CastingPlayerAttributes attributes; + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + chip::TLV::Tag castingPlayerContainerTag = reader.GetTag(); + VerifyOrReturnValue(chip::TLV::IsContextTag(castingPlayerContainerTag), std::vector(), + ChipLogError(AppServer, "Unexpected non-context TLV tag")); + + uint8_t castingPlayerContainerTagNum = static_cast(chip::TLV::TagNumFromTag(castingPlayerContainerTag)); + if (castingPlayerContainerTagNum == kCastingPlayerIdTag) + { + err = reader.GetBytes(reinterpret_cast(attributes.id), core::kIdMaxLength + 1); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.GetBytes failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerNodeIdTag) + { + err = reader.Get(attributes.nodeId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerFabricIndexTag) + { + err = reader.Get(attributes.fabricIndex); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerVendorIdTag) + { + err = reader.Get(attributes.vendorId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerProductIdTag) + { + err = reader.Get(attributes.productId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerDeviceTypeIdTag) + { + err = reader.Get(attributes.deviceType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerDeviceNameTag) + { + err = reader.GetBytes(reinterpret_cast(attributes.deviceName), chip::Dnssd::kMaxDeviceNameLen + 1); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.GetBytes failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (castingPlayerContainerTagNum == kCastingPlayerHostNameTag) + { + err = reader.GetBytes(reinterpret_cast(attributes.hostName), chip::Dnssd::kHostNameMaxLength + 1); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.GetBytes failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (err == CHIP_END_OF_TLV) + { + // Exiting CastingPlayer container + err = reader.ExitContainer(castingPlayerContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + core::CastingPlayer castingPlayer(attributes); + castingPlayers.push_back(castingPlayer); + break; + } + } + } + + VerifyOrReturnValue(err == CHIP_END_OF_TLV, std::vector(), + ChipLogError(AppServer, "TLV parsing failed %" CHIP_ERROR_FORMAT, err.Format())); + + err = reader.ExitContainer(castingPlayersContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + err = reader.ExitContainer(outerContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + ChipLogProgress(AppServer, "CastingStore::ReadAll CastingPlayers size: %lu", static_cast(castingPlayers.size())); + return castingPlayers; +} + +CHIP_ERROR CastingStore::DeleteAll() +{ + ChipLogProgress(AppServer, "CastingStore::DeleteAll called"); + CHIP_ERROR err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(kCastingStoreDataKey); + if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) // no error, if the key-value pair was not stored + { + ChipLogProgress(AppServer, "CastingStore::DeleteAll ignoring error %" CHIP_ERROR_FORMAT, err.Format()); + return CHIP_NO_ERROR; + } + return err; +} + +CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) +{ + ChipLogProgress(AppServer, "CastingStore::Delete"); + + // Read cache of CastingPlayers + std::vector castingPlayers = ReadAll(); + + // search for castingPlayer in CastingStore cache and delete it, if found + if (castingPlayers.size() != 0) + { + auto it = std::find_if( + castingPlayers.begin(), castingPlayers.end(), + [castingPlayer](const core::CastingPlayer & castingPlayerParam) { return castingPlayerParam == castingPlayer; }); + + if (it != castingPlayers.end()) + { + ChipLogProgress(AppServer, "CastingStore::Delete deleting CastingPlayer %s from CastingStore cache", it->GetId()); + castingPlayers.erase(it); + return WriteAll(castingPlayers); + } + } + return CHIP_NO_ERROR; +} + +void CastingStore::OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) +{ + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved"); + + // Read cache of CastingPlayers + std::vector castingPlayers = ReadAll(); + + // search for castingPlayer in CastingStore cache and delete it, if found + if (castingPlayers.size() != 0) + { + auto it = std::find_if(castingPlayers.begin(), castingPlayers.end(), + [fabricIndex](const core::CastingPlayer & castingPlayerParam) { + return castingPlayerParam.GetFabricIndex() == fabricIndex; + }); + + if (it != castingPlayers.end()) + { + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved deleting CastingPlayer %s from CastingStore cache", + it->GetId()); + castingPlayers.erase(it); + WriteAll(castingPlayers); + } + } +} + +CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayers) +{ + ChipLogProgress(AppServer, "CastingStore::WriteAll called"); + + chip::TLV::TLVWriter tlvWriter; + uint8_t castingStoreData[kCastingStoreDataMaxBytes]; + tlvWriter.Init(castingStoreData, kCastingStoreDataMaxBytes); + + chip::TLV::TLVType outerContainerType = chip::TLV::kTLVType_Structure; + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::AnonymousTag(), chip::TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingStoreDataVersionTag), kCurrentCastingStoreDataVersion)); + + chip::TLV::TLVType castingPlayersContainerType = chip::TLV::kTLVType_Array; + // CastingPlayers container starts + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayersContainerTag), chip::TLV::kTLVType_Array, + castingPlayersContainerType)); + + for (auto & castingPlayer : castingPlayers) + { + chip::TLV::TLVType castingPlayerContainerType = chip::TLV::kTLVType_Structure; + // CastingPlayer container starts + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerContainerTag), + chip::TLV::kTLVType_Structure, castingPlayerContainerType)); + + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerIdTag), castingPlayer.GetId())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerNodeIdTag), castingPlayer.GetNodeId())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerFabricIndexTag), castingPlayer.GetFabricIndex())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerVendorIdTag), castingPlayer.GetVendorId())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerProductIdTag), castingPlayer.GetProductId())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerDeviceTypeIdTag), castingPlayer.GetDeviceType())); + ReturnErrorOnFailure(tlvWriter.PutBytes(chip::TLV::ContextTag(kCastingPlayerDeviceNameTag), + (const uint8_t *) castingPlayer.GetDeviceName(), + static_cast(strlen(castingPlayer.GetDeviceName()) + 1))); + ReturnErrorOnFailure(tlvWriter.PutBytes(chip::TLV::ContextTag(kCastingPlayerHostNameTag), + (const uint8_t *) castingPlayer.GetHostName(), + static_cast(strlen(castingPlayer.GetHostName()) + 1))); + // CastingPlayer container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(castingPlayerContainerType)); + } + + // CastingPlayers container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(castingPlayersContainerType)); + ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); + + ReturnErrorOnFailure(tlvWriter.Finalize()); + ChipLogProgress(AppServer, + "CastingStore::WriteAll TLV(CastingStoreData).LengthWritten: %d bytes, CastingPlayers size: %lu " + "and version: %d", + tlvWriter.GetLengthWritten(), static_cast(castingPlayers.size()), + kCurrentCastingStoreDataVersion); + return chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Put(kCastingStoreDataKey, castingStoreData, + tlvWriter.GetLengthWritten()); +} + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.h b/examples/tv-casting-app/tv-casting-common/support/CastingStore.h new file mode 100644 index 00000000000000..3d8ec7f613511b --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.h @@ -0,0 +1,97 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "core/CastingPlayer.h" + +namespace matter { +namespace casting { +namespace support { + +/** + * @brief CastingStore uses TLV-encoding to cache casting related data on disk, like the list of CastingPlayers that the + * tv-casting-app previously connected to. + */ +class CastingStore : public chip::FabricTable::Delegate +{ +public: + static CastingStore * GetInstance(); + + /** + * @brief If castingPlayer already exists in the cache on disk (compares by castingPlayer.id), this will update the record for + * it in the cache. If castingPlayer is new i.e. not found, this will add it to the cache + */ + CHIP_ERROR AddOrUpdate(core::CastingPlayer castingPlayer); + + /** + * @brief Reads and returns a vector of all CastingPlayers found in the cache + */ + std::vector ReadAll(); + + /** + * @brief If castingPlayer is found in the cache, this will delete it. If it is not found, this method is a no-op + */ + CHIP_ERROR Delete(core::CastingPlayer castingPlayer); + + /** + * @brief Purges the cache of all CastingStore data + */ + CHIP_ERROR DeleteAll(); + + /** + * @brief Implements chip::FabricTable::Delegate.OnFabricRemoved. Searches for and deletes the CastingPlayer(s) that match(es) + * the fabrixIndex argument, if any. If no such CastingPlayer exists, this method is a no-op. + */ + void OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) override; + +private: + CastingStore(); + static CastingStore * _CastingStore; + + /** + * @brief Writes the vector of CastingPlayers to the cache. This method will overwrite any pre-existing cached data. + */ + CHIP_ERROR WriteAll(std::vector castingPlayers); + + enum CastingStoreTLVTag + { + kCastingStoreDataVersionTag = 1, + kCastingPlayersContainerTag, + kCastingPlayerContainerTag, + kCastingPlayerIdTag, + kCastingPlayerNodeIdTag, + kCastingPlayerFabricIndexTag, + kCastingPlayerVendorIdTag, + kCastingPlayerProductIdTag, + kCastingPlayerDeviceTypeIdTag, + kCastingPlayerDeviceNameTag, + kCastingPlayerHostNameTag, + + kContextTagMaxNum = UINT8_MAX + }; + + constexpr static size_t kCastingStoreDataMaxBytes = 1024 * 100; // 100 KBs + constexpr static char * kCastingStoreDataKey = (char *) "com.matter.casting.CastingStore"; + constexpr static uint32_t kCurrentCastingStoreDataVersion = 1; + constexpr static uint32_t kSupportedCastingStoreDataVersions[1] = { 1 }; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp new file mode 100644 index 00000000000000..704e4ef7295874 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp @@ -0,0 +1,189 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ChipDeviceEventHandler.h" + +#include "core/CastingPlayer.h" +#include "core/Types.h" +#include "support/CastingStore.h" + +#include "app/clusters/bindings/BindingManager.h" + +namespace matter { +namespace casting { +namespace support { + +using namespace matter::casting::core; + +bool ChipDeviceEventHandler::sUdcInProgress = false; + +void ChipDeviceEventHandler::Handle(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) +{ + ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle called"); + + bool runPostCommissioning = false; + chip::NodeId targetNodeId = 0; + chip::FabricIndex targetFabricIndex = 0; + + if (event->Type == chip::DeviceLayer::DeviceEventType::kFailSafeTimerExpired && + CastingPlayer::GetTargetCastingPlayer()->mConnectionState == CASTING_PLAYER_CONNECTING) + { + HandleFailSafeTimerExpired(); + } + else if (event->Type == chip::DeviceLayer::DeviceEventType::kBindingsChangedViaCluster && + CastingPlayer::GetTargetCastingPlayer() != nullptr) + { + HandleBindingsChangedViaCluster(event, arg, runPostCommissioning, targetNodeId, targetFabricIndex); + } + else if (event->Type == chip::DeviceLayer::DeviceEventType::kCommissioningComplete) + { + HandleCommissioningComplete(event, arg, runPostCommissioning, targetNodeId, targetFabricIndex); + } + + if (runPostCommissioning) + { + sUdcInProgress = false; + CastingPlayer::GetTargetCastingPlayer()->SetNodeId(targetNodeId); + CastingPlayer::GetTargetCastingPlayer()->SetFabricIndex(targetFabricIndex); + + CastingPlayer::GetTargetCastingPlayer()->FindOrEstablishSession( + nullptr, + [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { + ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle: Connection to CastingPlayer successful"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_CONNECTED; + support::CastingStore::GetInstance()->AddOrUpdate(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); + }, + [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { + ChipLogError(AppServer, "ChipDeviceEventHandler::Handle: Connection to CastingPlayer failed"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + support::CastingStore::GetInstance()->Delete(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(error, nullptr); + CastingPlayer::mTargetCastingPlayer = nullptr; + }); + } +} + +void ChipDeviceEventHandler::HandleFailSafeTimerExpired() +{ + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleFailSafeTimerExpired called"); + chip::DeviceLayer::SystemLayer().StartTimer( + chip::System::Clock::Milliseconds32(1), + [](chip::System::Layer * aSystemLayer, void * aAppState) { + ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle running OpenBasicCommissioningWindow"); + CHIP_ERROR err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow( + chip::System::Clock::Seconds16(CastingPlayer::GetTargetCastingPlayer()->mCommissioningWindowTimeoutSec)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "ChipDeviceEventHandler::Handle Failed to OpenBasicCommissioningWindow %" CHIP_ERROR_FORMAT, + err.Format()); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(err, nullptr); + return; + } + +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + err = CastingPlayer::GetTargetCastingPlayer()->SendUserDirectedCommissioningRequest(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, + "ChipDeviceEventHandler::Handle Failed to SendUserDirectedCommissioningRequest %" CHIP_ERROR_FORMAT, + err.Format()); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(err, nullptr); + return; + } +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + }, + nullptr); +} + +void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg, + bool & runPostCommissioning, chip::NodeId & targetNodeId, + chip::FabricIndex & targetFabricIndex) +{ + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster called"); + + if (CastingPlayer::GetTargetCastingPlayer()->IsConnected()) + { + // re-use existing nodeId and fabricIndex + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster already connected to video player"); + runPostCommissioning = true; + targetNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); + targetFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); + } + // handle the "re-commissioning" use case i.e. we received a kBindingsChangedViaCluster event when UDC was in progress (i.e. no + // kCommissioningComplete received) + else if (sUdcInProgress) + { + ChipLogProgress(AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster UDC is in progress while handling " + "kBindingsChangedViaCluster with " + "fabricIndex: %d", + event->BindingsChanged.fabricIndex); + sUdcInProgress = false; + + // find targetNodeId from binding table by matching the binding's fabricIndex with the accessing fabricIndex + // received in BindingsChanged event + for (const auto & binding : chip::BindingTable::GetInstance()) + { + ChipLogProgress(AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Read cached binding type=%d fabrixIndex=%d " + "nodeId=0x" ChipLogFormatX64 + " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, + binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, + binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0))); + if (binding.type == EMBER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex) + { + ChipLogProgress(AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Matched accessingFabricIndex with " + "nodeId=0x" ChipLogFormatX64, + ChipLogValueX64(binding.nodeId)); + targetNodeId = binding.nodeId; + targetFabricIndex = binding.fabricIndex; + runPostCommissioning = true; + break; + } + } + + if (targetNodeId == 0 && runPostCommissioning == false) + { + ChipLogError(AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster accessingFabricIndex: %d did not match bindings", + event->BindingsChanged.fabricIndex); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_ERROR_INCORRECT_STATE, + CastingPlayer::GetTargetCastingPlayer()); + return; + } + } +} + +void ChipDeviceEventHandler::HandleCommissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg, + bool & runPostCommissioning, chip::NodeId & targetNodeId, + chip::FabricIndex & targetFabricIndex) +{ + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleCommissioningComplete called"); + sUdcInProgress = false; + targetNodeId = event->CommissioningComplete.nodeId; + targetFabricIndex = event->CommissioningComplete.fabricIndex; + runPostCommissioning = true; +} + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h new file mode 100644 index 00000000000000..69142603ce40f0 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h @@ -0,0 +1,84 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace matter { +namespace casting { +namespace support { + +/** + * @brief Handles chip::DeviceLayer::ChipDeviceEvent events (such as kFailSafeTimerExpired, kBindingsChangedViaCluster, + * kCommissioningComplete) sent by the Matter DeviceLayer. + * ChipDeviceEventHandlerhelps the CastingPlayer class commission with and connect to a CastingPlayer + */ +class ChipDeviceEventHandler +{ +public: + /** + * @brief Top level handler to handle chip::DeviceLayer::ChipDeviceEvent. Delegates to HandleBindingsChangedViaCluster and other + * handlers + */ + static void Handle(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + + /** + * @brief Sets internal ChipDeviceEventHandler state to indicate that User Directed Commissioning (UDC) is in progress. + * If UDC was already in progress when this method was called, it will return a CHIP_ERROR_INCORRECT_STATE without changing the + * internal state. + */ + static CHIP_ERROR SetUdcStatus(bool udcInProgress) + { + if (sUdcInProgress == udcInProgress) + { + ChipLogError(AppServer, "UDC in progress state is already %d", sUdcInProgress); + return CHIP_ERROR_INCORRECT_STATE; + } + sUdcInProgress = udcInProgress; + return CHIP_NO_ERROR; + } + +private: + /** + * @brief if kFailSafeTimerExpired is received and a request to connect to a CastingPlayer is pending, open a basic + * commissioning window and send the user directed commissioning request to the target CastingPlayer + */ + static void HandleFailSafeTimerExpired(); + + /** + * @brief Handles cases where the tv-casting-app is being "re-commissioned" from a CastingPlayer that it was previously + * commissioned by. + */ + static void HandleBindingsChangedViaCluster(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg, + bool & runPostCommissioning, chip::NodeId & targetPeerNodeId, + chip::FabricIndex & targetFabricIndex); + + /** + * @brief Handles kCommissioningComplete event which is received when commissioning completes + */ + static void HandleCommissioningComplete(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg, + bool & runPostCommissioning, chip::NodeId & targetPeerNodeId, + chip::FabricIndex & targetFabricIndex); + + static bool sUdcInProgress; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter 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 0891d9589c9f4c..a98c4dbf1b207e 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 @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -43,11 +43,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -61,7 +61,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -78,7 +78,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -89,7 +89,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -112,33 +112,33 @@ server cluster Groups = 4 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ client cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -181,23 +181,23 @@ client cluster OnOff = 6 { /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ client cluster LevelControl = 8 { - enum MoveMode : ENUM8 { + enum MoveMode : enum8 { kUp = 0; kDown = 1; } - enum StepMode : ENUM8 { + enum StepMode : enum8 { kUp = 0; kDown = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kOnOff = 0x1; kLighting = 0x2; kFrequency = 0x4; } - bitmap LevelControlOptions : BITMAP8 { + bitmap LevelControlOptions : bitmap8 { kExecuteIfOff = 0x1; kCoupleColorTempToLevel = 0x2; } @@ -317,7 +317,7 @@ server cluster BinaryInputBasic = 15 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ client cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -348,7 +348,7 @@ client cluster Descriptor = 29 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -386,7 +386,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -400,13 +400,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -414,7 +414,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -472,7 +472,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -496,7 +496,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -562,7 +562,7 @@ server cluster BasicInformation = 40 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -577,7 +577,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -592,12 +592,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -617,13 +617,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -638,7 +638,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -646,7 +646,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -702,7 +702,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -718,7 +718,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -727,13 +727,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -842,7 +850,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -852,7 +860,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -866,7 +874,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -874,14 +882,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -947,8 +955,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -979,19 +987,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1000,7 +1008,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1010,7 +1018,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1051,7 +1059,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1064,7 +1072,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1085,26 +1093,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1117,7 +1129,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1131,12 +1143,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1178,7 +1190,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1186,14 +1198,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1216,12 +1228,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1232,7 +1244,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1247,12 +1259,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1339,17 +1351,17 @@ client cluster WakeOnLan = 1283 { /** This cluster provides an interface for controlling the current Channel on a device. */ client cluster Channel = 1284 { - enum ChannelStatusEnum : ENUM8 { + enum ChannelStatusEnum : enum8 { kSuccess = 0; kMultipleMatches = 1; kNoMatches = 2; } - enum LineupInfoTypeEnum : ENUM8 { + enum LineupInfoTypeEnum : enum8 { kMSO = 0; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kChannelList = 0x1; kLineupInfo = 0x2; } @@ -1407,7 +1419,7 @@ client cluster Channel = 1284 { /** This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. */ client cluster TargetNavigator = 1285 { - enum TargetNavigatorStatusEnum : ENUM8 { + enum TargetNavigatorStatusEnum : enum8 { kSuccess = 0; kTargetNotFound = 1; kNotAllowed = 2; @@ -1443,7 +1455,7 @@ client cluster TargetNavigator = 1285 { /** This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. */ client cluster MediaPlayback = 1286 { - enum MediaPlaybackStatusEnum : ENUM8 { + enum MediaPlaybackStatusEnum : enum8 { kSuccess = 0; kInvalidStateForCommand = 1; kNotAllowed = 2; @@ -1452,14 +1464,14 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } - enum PlaybackStateEnum : ENUM8 { + enum PlaybackStateEnum : enum8 { kPlaying = 0; kPaused = 1; kNotPlaying = 2; kBuffering = 3; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kAdvancedSeek = 0x1; kVariableSpeed = 0x2; } @@ -1526,7 +1538,7 @@ client cluster MediaPlayback = 1286 { /** This cluster provides an interface for controlling the Input Selector on a media device such as a TV. */ client cluster MediaInput = 1287 { - enum InputTypeEnum : ENUM8 { + enum InputTypeEnum : enum8 { kInternal = 0; kAux = 1; kCoax = 2; @@ -1541,15 +1553,15 @@ client cluster MediaInput = 1287 { kOther = 11; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct InputInfoStruct { int8u index = 0; InputTypeEnum inputType = 1; - char_string<32> name = 2; - char_string<32> description = 3; + char_string name = 2; + char_string description = 3; } readonly attribute InputInfoStruct inputList[] = 0; @@ -1577,7 +1589,7 @@ client cluster MediaInput = 1287 { /** Upon receipt, this SHALL hide the input list from the screen. */ command HideInputStatus(): DefaultSuccess = 2; /** Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. */ - command RenameInput(RenameInputRequest): DefaultSuccess = 3; + command access(invoke: manage) RenameInput(RenameInputRequest): DefaultSuccess = 3; } /** This cluster provides an interface for managing low power mode on a device. */ @@ -1595,7 +1607,7 @@ client cluster LowPower = 1288 { /** This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. */ client cluster KeypadInput = 1289 { - enum CecKeyCode : ENUM8 { + enum CecKeyCode : enum8 { kSelect = 0; kUp = 1; kDown = 2; @@ -1684,13 +1696,13 @@ client cluster KeypadInput = 1289 { kData = 118; } - enum KeypadInputStatusEnum : ENUM8 { + enum KeypadInputStatusEnum : enum8 { kSuccess = 0; kUnsupportedKey = 1; kInvalidKeyInCurrentState = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNavigationKeyCodes = 0x1; kLocationKeys = 0x2; kNumberKeys = 0x4; @@ -1717,18 +1729,18 @@ client cluster KeypadInput = 1289 { /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ContentLauncher = 1290 { - enum ContentLaunchStatusEnum : ENUM8 { + enum ContentLaunchStatusEnum : enum8 { kSuccess = 0; kUrlNotAvailable = 1; kAuthFailed = 2; } - enum MetricTypeEnum : ENUM8 { + enum MetricTypeEnum : enum8 { kPixels = 0; kPercentage = 1; } - enum ParameterEnum : ENUM8 { + enum ParameterEnum : enum8 { kActor = 0; kChannel = 1; kCharacter = 2; @@ -1745,12 +1757,12 @@ client cluster ContentLauncher = 1290 { kVideo = 13; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kContentSearch = 0x1; kURLPlayback = 0x2; } - bitmap SupportedStreamingProtocol : BITMAP32 { + bitmap SupportedStreamingProtocol : bitmap32 { kDASH = 0x1; kHLS = 0x2; } @@ -1825,7 +1837,7 @@ client cluster ContentLauncher = 1290 { /** This cluster provides an interface for controlling the Output on a media device such as a TV. */ client cluster AudioOutput = 1291 { - enum OutputTypeEnum : ENUM8 { + enum OutputTypeEnum : enum8 { kHDMI = 0; kBT = 1; kOptical = 2; @@ -1834,18 +1846,18 @@ client cluster AudioOutput = 1291 { kOther = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kNameUpdates = 0x1; } struct OutputInfoStruct { int8u index = 0; OutputTypeEnum outputType = 1; - char_string<32> name = 2; + char_string name = 2; } readonly attribute OutputInfoStruct outputList[] = 0; - readonly attribute optional int8u currentOutput = 1; + readonly attribute int8u currentOutput = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1865,18 +1877,18 @@ client cluster AudioOutput = 1291 { /** Upon receipt, this SHALL change the output on the media device to the output at a specific index in the Output List. */ command SelectOutput(SelectOutputRequest): DefaultSuccess = 0; /** Upon receipt, this SHALL rename the output at a specific index in the Output List. Updates to the output name SHALL appear in the TV settings menus. */ - command RenameOutput(RenameOutputRequest): DefaultSuccess = 1; + command access(invoke: manage) RenameOutput(RenameOutputRequest): DefaultSuccess = 1; } /** This cluster provides an interface for launching content on a media player device such as a TV or Speaker. */ client cluster ApplicationLauncher = 1292 { - enum ApplicationLauncherStatusEnum : ENUM8 { + enum ApplicationLauncherStatusEnum : enum8 { kSuccess = 0; kAppNotAvailable = 1; kSystemBusy = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kApplicationPlatform = 0x1; } @@ -1927,7 +1939,7 @@ client cluster ApplicationLauncher = 1292 { /** This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. */ client cluster ApplicationBasic = 1293 { - enum ApplicationStatusEnum : ENUM8 { + enum ApplicationStatusEnum : enum8 { kStopped = 0; kActiveVisibleFocus = 1; kActiveHidden = 2; @@ -1941,12 +1953,12 @@ client cluster ApplicationBasic = 1293 { readonly attribute optional char_string<32> vendorName = 0; readonly attribute optional vendor_id vendorID = 1; - readonly attribute char_string<32> applicationName = 2; + readonly attribute long_char_string<256> applicationName = 2; readonly attribute optional int16u productID = 3; readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; - readonly attribute vendor_id allowedVendorList[] = 7; + readonly attribute access(read: administer) vendor_id allowedVendorList[] = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index ffc7f1d33be2c8..b231ccb0ec904f 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -2236,7 +2236,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4366,5 +4366,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/.gitignore b/examples/virtual-device-app/android/App/feature/closure/.gitignore new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/examples/virtual-device-app/android/App/feature/closure/build.gradle.kts b/examples/virtual-device-app/android/App/feature/closure/build.gradle.kts new file mode 100644 index 00000000000000..455f2013f3935e --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/build.gradle.kts @@ -0,0 +1,70 @@ +import com.matter.buildsrc.Deps +import com.matter.buildsrc.Versions + +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + id("com.google.dagger.hilt.android") + id("androidx.navigation.safeargs.kotlin") + kotlin("kapt") +} + +android { + namespace = "com.matter.virtual.device.app.feature.closure" + compileSdk = Versions.compileSdkVersion + + defaultConfig { + minSdk = Versions.minSdkVersion + targetSdk = Versions.targetSdkVersion + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + viewBinding = true + dataBinding = true + } +} + +dependencies { + + implementation(project(":core:common")) + implementation(project(":core:domain")) + implementation(project(":core:ui")) + + implementation(Deps.AndroidX.core) + implementation(Deps.AndroidX.appcompat) + implementation(Deps.AndroidX.fragment) + implementation(Deps.AndroidX.Lifecycle.viewmodel) + + implementation(Deps.Kotlin.serialization) + + implementation(Deps.Navigation.fragment) + implementation(Deps.Navigation.ui) + + implementation(Deps.Dagger.hiltAndroid) + kapt(Deps.Dagger.hiltAndroidCompiler) + + implementation(Deps.timber) + + testImplementation(Deps.Test.junit) + androidTestImplementation(Deps.Test.junitExt) + androidTestImplementation(Deps.Test.espresso) +} \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/proguard-rules.pro b/examples/virtual-device-app/android/App/feature/closure/proguard-rules.pro new file mode 100644 index 00000000000000..481bb434814107 --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/src/androidTest/java/com/matter/virtual/device/app/feature/closure/ExampleInstrumentedTest.kt b/examples/virtual-device-app/android/App/feature/closure/src/androidTest/java/com/matter/virtual/device/app/feature/closure/ExampleInstrumentedTest.kt new file mode 100644 index 00000000000000..5e4178d42aa18b --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/androidTest/java/com/matter/virtual/device/app/feature/closure/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.matter.virtual.device.app.feature.closure + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.* +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.matter.virtual.device.app.feature.closure.test", appContext.packageName) + } +} diff --git a/examples/virtual-device-app/android/App/feature/closure/src/main/AndroidManifest.xml b/examples/virtual-device-app/android/App/feature/closure/src/main/AndroidManifest.xml new file mode 100644 index 00000000000000..a5918e68abcdde --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockFragment.kt b/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockFragment.kt new file mode 100644 index 00000000000000..8cfe6a403f53ed --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockFragment.kt @@ -0,0 +1,41 @@ +package com.matter.virtual.device.app.feature.closure + +import androidx.fragment.app.viewModels +import androidx.navigation.fragment.navArgs +import com.matter.virtual.device.app.core.ui.BaseFragment +import com.matter.virtual.device.app.core.ui.databinding.LayoutAppbarBinding +import com.matter.virtual.device.app.feature.closure.databinding.FragmentDoorLockBinding +import dagger.hilt.android.AndroidEntryPoint +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.decodeFromString +import kotlinx.serialization.json.Json +import timber.log.Timber + +@AndroidEntryPoint +class DoorLockFragment : + BaseFragment(R.layout.fragment_door_lock) { + + override val viewModel: DoorLockViewModel by viewModels() + + @OptIn(ExperimentalSerializationApi::class) + override fun setupNavArgs() { + val args: DoorLockFragmentArgs by navArgs() + matterSettings = Json.decodeFromString(args.setting) + } + + override fun setupAppbar(): LayoutAppbarBinding = binding.appbar + + override fun setupUi() {} + + override fun setupObservers() {} + + override fun onResume() { + Timber.d("onResume()") + super.onResume() + } + + override fun onDestroy() { + Timber.d("onDestroy()") + super.onDestroy() + } +} diff --git a/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockViewModel.kt b/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockViewModel.kt new file mode 100644 index 00000000000000..35a9a19ff634f4 --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/main/java/com/matter/virtual/device/app/feature/closure/DoorLockViewModel.kt @@ -0,0 +1,17 @@ +package com.matter.virtual.device.app.feature.closure + +import androidx.lifecycle.SavedStateHandle +import com.matter.virtual.device.app.core.ui.BaseViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject +import timber.log.Timber + +@HiltViewModel +class DoorLockViewModel @Inject constructor(savedStateHandle: SavedStateHandle) : + BaseViewModel(savedStateHandle) { + + override fun onCleared() { + Timber.d("onCleared()") + super.onCleared() + } +} diff --git a/examples/virtual-device-app/android/App/feature/closure/src/main/res/layout/fragment_door_lock.xml b/examples/virtual-device-app/android/App/feature/closure/src/main/res/layout/fragment_door_lock.xml new file mode 100644 index 00000000000000..d726e82e616348 --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/main/res/layout/fragment_door_lock.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/src/main/res/navigation/closure_nav_graph.xml b/examples/virtual-device-app/android/App/feature/closure/src/main/res/navigation/closure_nav_graph.xml new file mode 100644 index 00000000000000..d56b030dc252a8 --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/main/res/navigation/closure_nav_graph.xml @@ -0,0 +1,16 @@ + + + + + + + \ No newline at end of file diff --git a/examples/virtual-device-app/android/App/feature/closure/src/test/java/com/matter/virtual/device/app/feature/closure/ExampleUnitTest.kt b/examples/virtual-device-app/android/App/feature/closure/src/test/java/com/matter/virtual/device/app/feature/closure/ExampleUnitTest.kt new file mode 100644 index 00000000000000..13c92b81c9b741 --- /dev/null +++ b/examples/virtual-device-app/android/App/feature/closure/src/test/java/com/matter/virtual/device/app/feature/closure/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.matter.virtual.device.app.feature.closure + +import org.junit.Assert.* +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/examples/virtual-device-app/android/App/settings.gradle.kts b/examples/virtual-device-app/android/App/settings.gradle.kts index a1bded5ee3a6b0..5bdf9465c3abb8 100644 --- a/examples/virtual-device-app/android/App/settings.gradle.kts +++ b/examples/virtual-device-app/android/App/settings.gradle.kts @@ -21,6 +21,7 @@ include(":core:matter") include(":core:model") include(":core:ui") include(":feature:control") +include(":feature:closure") include(":feature:main") include(":feature:qrcode") include(":feature:setup") diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index e20e6d41f29309..0c56f79c581271 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,14 +118,14 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; kTableSize = 0x4; kFabricScenes = 0x8; } - bitmap ScenesCopyMode : BITMAP8 { + bitmap ScenesCopyMode : bitmap8 { kCopyAllScenes = 0x1; } @@ -240,33 +240,33 @@ provisional server cluster Scenes = 5 { /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : ENUM8 { + enum DelayedAllOffEffectVariantEnum : enum8 { kDelayedOffFastFade = 0; kNoFade = 1; kDelayedOffSlowFade = 2; } - enum DyingLightEffectVariantEnum : ENUM8 { + enum DyingLightEffectVariantEnum : enum8 { kDyingLightFadeOff = 0; } - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kDelayedAllOff = 0; kDyingLight = 1; } - enum StartUpOnOffEnum : ENUM8 { + enum StartUpOnOffEnum : enum8 { kOff = 0; kOn = 1; kToggle = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLighting = 0x1; kDeadFrontBehavior = 0x2; } - bitmap OnOffControlBitmap : BITMAP8 { + bitmap OnOffControlBitmap : bitmap8 { kAcceptOnlyWhenOn = 0x1; } @@ -303,7 +303,7 @@ server cluster OnOff = 6 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -341,7 +341,7 @@ server cluster Binding = 30 { fabric_idx fabricIndex = 254; } - attribute TargetStruct binding[] = 0; + attribute access(write: manage) TargetStruct binding[] = 0; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -355,13 +355,13 @@ server cluster Binding = 30 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -369,7 +369,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -427,7 +427,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -451,7 +451,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -515,20 +515,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ server cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -589,7 +589,7 @@ server cluster OtaSoftwareUpdateProvider = 41 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -604,7 +604,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -619,12 +619,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -644,13 +644,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -665,7 +665,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -701,7 +701,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -715,20 +715,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -812,38 +812,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -895,7 +895,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -903,7 +903,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -959,7 +959,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -975,7 +975,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -984,13 +984,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -1099,13 +1107,13 @@ server cluster NetworkCommissioning = 49 { /** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ server cluster DiagnosticLogs = 50 { - enum IntentEnum : ENUM8 { + enum IntentEnum : enum8 { kEndUserSupport = 0; kNetworkDiag = 1; kCrashLogs = 2; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kSuccess = 0; kExhausted = 1; kNoLogs = 2; @@ -1113,7 +1121,7 @@ server cluster DiagnosticLogs = 50 { kDenied = 4; } - enum TransferProtocolEnum : ENUM8 { + enum TransferProtocolEnum : enum8 { kResponsePayload = 0; kBDX = 1; } @@ -1136,7 +1144,7 @@ server cluster DiagnosticLogs = 50 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -1146,7 +1154,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1160,7 +1168,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1168,14 +1176,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1241,8 +1249,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1273,19 +1281,19 @@ server cluster SoftwareDiagnostics = 52 { /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1295,7 +1303,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1434,19 +1442,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1455,7 +1463,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1465,7 +1473,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1506,7 +1514,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1519,7 +1527,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1540,26 +1548,30 @@ server cluster EthernetNetworkDiagnostics = 55 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetCounts(): DefaultSuccess = 0; + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1572,7 +1584,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1586,12 +1598,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1633,7 +1645,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1641,14 +1653,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1671,12 +1683,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1687,7 +1699,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1702,12 +1714,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1807,7 +1819,7 @@ server cluster UserLabel = 65 { /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { - enum AlarmCodeEnum : ENUM8 { + enum AlarmCodeEnum : enum8 { kLockJammed = 0; kLockFactoryReset = 1; kLockRadioPowerCycled = 3; @@ -1818,13 +1830,13 @@ server cluster DoorLock = 257 { kForcedUser = 8; } - enum CredentialRuleEnum : ENUM8 { + enum CredentialRuleEnum : enum8 { kSingle = 0; kDual = 1; kTri = 2; } - enum CredentialTypeEnum : ENUM8 { + enum CredentialTypeEnum : enum8 { kProgrammingPIN = 0; kPIN = 1; kRFID = 2; @@ -1833,20 +1845,20 @@ server cluster DoorLock = 257 { kFace = 5; } - enum DataOperationTypeEnum : ENUM8 { + enum DataOperationTypeEnum : enum8 { kAdd = 0; kClear = 1; kModify = 2; } - enum DlLockState : ENUM8 { + enum DlLockState : enum8 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; kUnlatched = 3; } - enum DlLockType : ENUM8 { + enum DlLockType : enum8 { kDeadBolt = 0; kMagnetic = 1; kOther = 2; @@ -1861,7 +1873,7 @@ server cluster DoorLock = 257 { kEurocylinder = 11; } - enum DlStatus : ENUM8 { + enum DlStatus : enum8 { kSuccess = 0; kFailure = 1; kDuplicate = 2; @@ -1871,7 +1883,7 @@ server cluster DoorLock = 257 { kNotFound = 139; } - enum DoorLockOperationEventCode : ENUM8 { + enum DoorLockOperationEventCode : enum8 { kUnknownOrMfgSpecific = 0; kLock = 1; kUnlock = 2; @@ -1889,7 +1901,7 @@ server cluster DoorLock = 257 { kManualUnlock = 14; } - enum DoorLockProgrammingEventCode : ENUM8 { + enum DoorLockProgrammingEventCode : enum8 { kUnknownOrMfgSpecific = 0; kMasterCodeChanged = 1; kPinAdded = 2; @@ -1899,21 +1911,21 @@ server cluster DoorLock = 257 { kIdDeleted = 6; } - enum DoorLockSetPinOrIdStatus : ENUM8 { + enum DoorLockSetPinOrIdStatus : enum8 { kSuccess = 0; kGeneralFailure = 1; kMemoryFull = 2; kDuplicateCodeError = 3; } - enum DoorLockUserStatus : ENUM8 { + enum DoorLockUserStatus : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; kNotSupported = 255; } - enum DoorLockUserType : ENUM8 { + enum DoorLockUserType : enum8 { kUnrestricted = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -1922,7 +1934,7 @@ server cluster DoorLock = 257 { kNotSupported = 255; } - enum DoorStateEnum : ENUM8 { + enum DoorStateEnum : enum8 { kDoorOpen = 0; kDoorClosed = 1; kDoorJammed = 2; @@ -1931,7 +1943,7 @@ server cluster DoorLock = 257 { kDoorAjar = 5; } - enum LockDataTypeEnum : ENUM8 { + enum LockDataTypeEnum : enum8 { kUnspecified = 0; kProgrammingCode = 1; kUserIndex = 2; @@ -1945,7 +1957,7 @@ server cluster DoorLock = 257 { kFace = 10; } - enum LockOperationTypeEnum : ENUM8 { + enum LockOperationTypeEnum : enum8 { kLock = 0; kUnlock = 1; kNonAccessUserEvent = 2; @@ -1953,7 +1965,7 @@ server cluster DoorLock = 257 { kUnlatch = 4; } - enum OperatingModeEnum : ENUM8 { + enum OperatingModeEnum : enum8 { kNormal = 0; kVacation = 1; kPrivacy = 2; @@ -1961,7 +1973,7 @@ server cluster DoorLock = 257 { kPassage = 4; } - enum OperationErrorEnum : ENUM8 { + enum OperationErrorEnum : enum8 { kUnspecified = 0; kInvalidCredential = 1; kDisabledUserDenied = 2; @@ -1969,7 +1981,7 @@ server cluster DoorLock = 257 { kInsufficientBattery = 4; } - enum OperationSourceEnum : ENUM8 { + enum OperationSourceEnum : enum8 { kUnspecified = 0; kManual = 1; kProprietaryRemote = 2; @@ -1982,13 +1994,13 @@ server cluster DoorLock = 257 { kBiometric = 9; } - enum UserStatusEnum : ENUM8 { + enum UserStatusEnum : enum8 { kAvailable = 0; kOccupiedEnabled = 1; kOccupiedDisabled = 3; } - enum UserTypeEnum : ENUM8 { + enum UserTypeEnum : enum8 { kUnrestrictedUser = 0; kYearDayScheduleUser = 1; kWeekDayScheduleUser = 2; @@ -2001,7 +2013,7 @@ server cluster DoorLock = 257 { kRemoteOnlyUser = 9; } - bitmap DaysMaskMap : BITMAP8 { + bitmap DaysMaskMap : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2011,19 +2023,19 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap DlCredentialRuleMask : BITMAP8 { + bitmap DlCredentialRuleMask : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlCredentialRulesSupport : BITMAP8 { + bitmap DlCredentialRulesSupport : bitmap8 { kSingle = 0x1; kDual = 0x2; kTri = 0x4; } - bitmap DlDefaultConfigurationRegister : BITMAP16 { + bitmap DlDefaultConfigurationRegister : bitmap16 { kEnableLocalProgrammingEnabled = 0x1; kKeypadInterfaceDefaultAccessEnabled = 0x2; kRemoteInterfaceDefaultAccessIsEnabled = 0x4; @@ -2032,7 +2044,7 @@ server cluster DoorLock = 257 { kLEDSettingsSet = 0x80; } - bitmap DlKeypadOperationEventMask : BITMAP16 { + bitmap DlKeypadOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2043,7 +2055,7 @@ server cluster DoorLock = 257 { kNonAccessUserOpEvent = 0x80; } - bitmap DlKeypadProgrammingEventMask : BITMAP16 { + bitmap DlKeypadProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -2051,14 +2063,14 @@ server cluster DoorLock = 257 { kPINChanged = 0x10; } - bitmap DlLocalProgrammingFeatures : BITMAP8 { + bitmap DlLocalProgrammingFeatures : bitmap8 { kAddUsersCredentialsSchedulesLocally = 0x1; kModifyUsersCredentialsSchedulesLocally = 0x2; kClearUsersCredentialsSchedulesLocally = 0x4; kAdjustLockSettingsLocally = 0x8; } - bitmap DlManualOperationEventMask : BITMAP16 { + bitmap DlManualOperationEventMask : bitmap16 { kUnknown = 0x1; kThumbturnLock = 0x2; kThumbturnUnlock = 0x4; @@ -2072,7 +2084,7 @@ server cluster DoorLock = 257 { kManualUnlock = 0x400; } - bitmap DlRFIDOperationEventMask : BITMAP16 { + bitmap DlRFIDOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2082,13 +2094,13 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRFIDProgrammingEventMask : BITMAP16 { + bitmap DlRFIDProgrammingEventMask : bitmap16 { kUnknown = 0x1; kRFIDCodeAdded = 0x20; kRFIDCodeCleared = 0x40; } - bitmap DlRemoteOperationEventMask : BITMAP16 { + bitmap DlRemoteOperationEventMask : bitmap16 { kUnknown = 0x1; kLock = 0x2; kUnlock = 0x4; @@ -2098,7 +2110,7 @@ server cluster DoorLock = 257 { kUnlockInvalidSchedule = 0x40; } - bitmap DlRemoteProgrammingEventMask : BITMAP16 { + bitmap DlRemoteProgrammingEventMask : bitmap16 { kUnknown = 0x1; kProgrammingPINChanged = 0x2; kPINAdded = 0x4; @@ -2108,7 +2120,7 @@ server cluster DoorLock = 257 { kRFIDCodeCleared = 0x40; } - bitmap DlSupportedOperatingModes : BITMAP16 { + bitmap DlSupportedOperatingModes : bitmap16 { kNormal = 0x1; kVacation = 0x2; kPrivacy = 0x4; @@ -2116,7 +2128,7 @@ server cluster DoorLock = 257 { kPassage = 0x10; } - bitmap DoorLockDayOfWeek : BITMAP8 { + bitmap DoorLockDayOfWeek : bitmap8 { kSunday = 0x1; kMonday = 0x2; kTuesday = 0x4; @@ -2126,7 +2138,7 @@ server cluster DoorLock = 257 { kSaturday = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPINCredential = 0x1; kRFIDCredential = 0x2; kFingerCredentials = 0x4; @@ -2365,53 +2377,53 @@ server cluster DoorLock = 257 { /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { - enum ColorLoopAction : ENUM8 { + enum ColorLoopAction : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : ENUM8 { + enum ColorLoopDirection : enum8 { kDecrementHue = 0; kIncrementHue = 1; } - enum ColorMode : ENUM8 { + enum ColorMode : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; kColorTemperature = 2; } - enum HueDirection : ENUM8 { + enum HueDirection : enum8 { kShortestDistance = 0; kLongestDistance = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : ENUM8 { + enum HueMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum HueStepMode : ENUM8 { + enum HueStepMode : enum8 { kUp = 1; kDown = 3; } - enum SaturationMoveMode : ENUM8 { + enum SaturationMoveMode : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : ENUM8 { + enum SaturationStepMode : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : BITMAP16 { + bitmap ColorCapabilities : bitmap16 { kHueSaturationSupported = 0x1; kEnhancedHueSupported = 0x2; kColorLoopSupported = 0x4; @@ -2419,14 +2431,14 @@ server cluster ColorControl = 768 { kColorTemperatureSupported = 0x10; } - bitmap ColorLoopUpdateFlags : BITMAP8 { + bitmap ColorLoopUpdateFlags : bitmap8 { kUpdateAction = 0x1; kUpdateDirection = 0x2; kUpdateTime = 0x4; kUpdateStartHue = 0x8; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kHueAndSaturation = 0x1; kEnhancedHue = 0x2; kColorLoop = 0x4; @@ -2874,10 +2886,14 @@ endpoint 1 { ram attribute currentGroup default = 0x0000; ram attribute sceneValid default = 0x00; ram attribute nameSupport; - ram attribute sceneTableSize; - callback attribute remainingCapacity; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; + ram attribute sceneTableSize default = 16; + callback attribute remainingCapacity default = 8; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 7; + ram attribute clusterRevision default = 5; handle command AddScene; handle command AddSceneResponse; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index 1225c244bc57ef..ea5776de0b3587 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -3463,7 +3463,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -4332,6 +4332,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -4529,7 +4530,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "16", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4545,6 +4546,70 @@ "storageOption": "External", "singleton": 0, "bounded": 0, + "defaultValue": "8", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, "defaultValue": "", "reportable": 1, "minInterval": 1, @@ -4561,7 +4626,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4577,7 +4642,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "5", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6057,5 +6122,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 9251732f79fdbb..f997baf66cfc98 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -3,7 +3,7 @@ /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { - enum EffectIdentifierEnum : ENUM8 { + enum EffectIdentifierEnum : enum8 { kBlink = 0; kBreathe = 1; kOkay = 2; @@ -12,11 +12,11 @@ server cluster Identify = 3 { kStopEffect = 255; } - enum EffectVariantEnum : ENUM8 { + enum EffectVariantEnum : enum8 { kDefault = 0; } - enum IdentifyTypeEnum : ENUM8 { + enum IdentifyTypeEnum : enum8 { kNone = 0; kLightOutput = 1; kVisibleIndicator = 2; @@ -49,11 +49,11 @@ server cluster Identify = 3 { /** Attributes and commands for group configuration and manipulation. */ server cluster Groups = 4 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kGroupNames = 0x1; } - bitmap NameSupportBitmap : BITMAP8 { + bitmap NameSupportBitmap : bitmap8 { kGroupNames = 0x80; } @@ -67,7 +67,7 @@ server cluster Groups = 4 { request struct AddGroupRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } request struct ViewGroupRequest { @@ -84,7 +84,7 @@ server cluster Groups = 4 { request struct AddGroupIfIdentifyingRequest { group_id groupID = 0; - char_string groupName = 1; + char_string<16> groupName = 1; } response struct AddGroupResponse = 0 { @@ -95,7 +95,7 @@ server cluster Groups = 4 { response struct ViewGroupResponse = 1 { enum8 status = 0; group_id groupID = 1; - char_string groupName = 2; + char_string<16> groupName = 2; } response struct GetGroupMembershipResponse = 2 { @@ -118,7 +118,7 @@ server cluster Groups = 4 { /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTagList = 0x1; } @@ -151,13 +151,13 @@ server cluster Descriptor = 29 { and enforce Access Control for the Node's endpoints and their associated cluster instances. */ server cluster AccessControl = 31 { - enum AccessControlEntryAuthModeEnum : ENUM8 { + enum AccessControlEntryAuthModeEnum : enum8 { kPASE = 1; kCASE = 2; kGroup = 3; } - enum AccessControlEntryPrivilegeEnum : ENUM8 { + enum AccessControlEntryPrivilegeEnum : enum8 { kView = 1; kProxyView = 2; kOperate = 3; @@ -165,7 +165,7 @@ server cluster AccessControl = 31 { kAdminister = 5; } - enum ChangeTypeEnum : ENUM8 { + enum ChangeTypeEnum : enum8 { kChanged = 0; kAdded = 1; kRemoved = 2; @@ -223,7 +223,7 @@ server cluster AccessControl = 31 { Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, which apply to the whole Node. Also allows setting user device information such as location. */ server cluster BasicInformation = 40 { - enum ColorEnum : ENUM8 { + enum ColorEnum : enum8 { kBlack = 0; kNavy = 1; kGreen = 2; @@ -247,7 +247,7 @@ server cluster BasicInformation = 40 { kGold = 20; } - enum ProductFinishEnum : ENUM8 { + enum ProductFinishEnum : enum8 { kOther = 0; kMatte = 1; kSatin = 2; @@ -310,20 +310,20 @@ server cluster BasicInformation = 40 { /** Provides an interface for providing OTA software updates */ client cluster OtaSoftwareUpdateProvider = 41 { - enum ApplyUpdateActionEnum : ENUM8 { + enum ApplyUpdateActionEnum : enum8 { kProceed = 0; kAwaitNextAction = 1; kDiscontinue = 2; } - enum DownloadProtocolEnum : ENUM8 { + enum DownloadProtocolEnum : enum8 { kBDXSynchronous = 0; kBDXAsynchronous = 1; kHTTPS = 2; kVendorSpecific = 3; } - enum StatusEnum : ENUM8 { + enum StatusEnum : enum8 { kUpdateAvailable = 0; kBusy = 1; kNotAvailable = 2; @@ -384,13 +384,13 @@ client cluster OtaSoftwareUpdateProvider = 41 { /** Provides an interface for downloading and applying OTA software updates */ server cluster OtaSoftwareUpdateRequestor = 42 { - enum AnnouncementReasonEnum : ENUM8 { + enum AnnouncementReasonEnum : enum8 { kSimpleAnnouncement = 0; kUpdateAvailable = 1; kUrgentUpdateAvailable = 2; } - enum ChangeReasonEnum : ENUM8 { + enum ChangeReasonEnum : enum8 { kUnknown = 0; kSuccess = 1; kFailure = 2; @@ -398,7 +398,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { kDelayByProvider = 4; } - enum UpdateStateEnum : ENUM8 { + enum UpdateStateEnum : enum8 { kUnknown = 0; kIdle = 1; kQuerying = 2; @@ -462,7 +462,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 { standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc */ server cluster LocalizationConfiguration = 43 { - attribute char_string<35> activeLocale = 0; + attribute access(write: manage) char_string<35> activeLocale = 0; readonly attribute char_string supportedLocales[] = 1; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -477,7 +477,7 @@ server cluster LocalizationConfiguration = 43 { or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. */ server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : ENUM8 { + enum CalendarTypeEnum : enum8 { kBuddhist = 0; kChinese = 1; kCoptic = 2; @@ -492,12 +492,12 @@ server cluster TimeFormatLocalization = 44 { kTaiwanese = 11; } - enum HourFormatEnum : ENUM8 { + enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCalendarFormat = 0x1; } @@ -517,13 +517,13 @@ server cluster TimeFormatLocalization = 44 { user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. */ server cluster UnitLocalization = 45 { - enum TempUnitEnum : ENUM8 { + enum TempUnitEnum : enum8 { kFahrenheit = 0; kCelsius = 1; kKelvin = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kTemperatureUnit = 0x1; } @@ -537,7 +537,7 @@ server cluster UnitLocalization = 45 { /** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ server cluster PowerSource = 47 { - enum BatApprovedChemistryEnum : ENUM16 { + enum BatApprovedChemistryEnum : enum16 { kUnspecified = 0; kAlkaline = 1; kLithiumCarbonFluoride = 2; @@ -573,7 +573,7 @@ server cluster PowerSource = 47 { kZincCerium = 32; } - enum BatChargeFaultEnum : ENUM8 { + enum BatChargeFaultEnum : enum8 { kUnspecified = 0; kAmbientTooHot = 1; kAmbientTooCold = 2; @@ -587,20 +587,20 @@ server cluster PowerSource = 47 { kSafetyTimeout = 10; } - enum BatChargeLevelEnum : ENUM8 { + enum BatChargeLevelEnum : enum8 { kOK = 0; kWarning = 1; kCritical = 2; } - enum BatChargeStateEnum : ENUM8 { + enum BatChargeStateEnum : enum8 { kUnknown = 0; kIsCharging = 1; kIsAtFullCharge = 2; kIsNotCharging = 3; } - enum BatCommonDesignationEnum : ENUM16 { + enum BatCommonDesignationEnum : enum16 { kUnspecified = 0; kAAA = 1; kAA = 2; @@ -684,38 +684,38 @@ server cluster PowerSource = 47 { k32600 = 80; } - enum BatFaultEnum : ENUM8 { + enum BatFaultEnum : enum8 { kUnspecified = 0; kOverTemp = 1; kUnderTemp = 2; } - enum BatReplaceabilityEnum : ENUM8 { + enum BatReplaceabilityEnum : enum8 { kUnspecified = 0; kNotReplaceable = 1; kUserReplaceable = 2; kFactoryReplaceable = 3; } - enum PowerSourceStatusEnum : ENUM8 { + enum PowerSourceStatusEnum : enum8 { kUnspecified = 0; kActive = 1; kStandby = 2; kUnavailable = 3; } - enum WiredCurrentTypeEnum : ENUM8 { + enum WiredCurrentTypeEnum : enum8 { kAC = 0; kDC = 1; } - enum WiredFaultEnum : ENUM8 { + enum WiredFaultEnum : enum8 { kUnspecified = 0; kOverVoltage = 1; kUnderVoltage = 2; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWired = 0x1; kBattery = 0x2; kRechargeable = 0x4; @@ -772,7 +772,7 @@ server cluster PowerSource = 47 { /** This cluster is used to manage global aspects of the Commissioning flow. */ server cluster GeneralCommissioning = 48 { - enum CommissioningErrorEnum : ENUM8 { + enum CommissioningErrorEnum : enum8 { kOK = 0; kValueOutsideRange = 1; kInvalidAuthentication = 2; @@ -780,7 +780,7 @@ server cluster GeneralCommissioning = 48 { kBusyWithOtherAdmin = 4; } - enum RegulatoryLocationTypeEnum : ENUM8 { + enum RegulatoryLocationTypeEnum : enum8 { kIndoor = 0; kOutdoor = 1; kIndoorOutdoor = 2; @@ -836,7 +836,7 @@ server cluster GeneralCommissioning = 48 { /** Functionality to configure, enable, disable network credentials and access on a Matter device. */ server cluster NetworkCommissioning = 49 { - enum NetworkCommissioningStatusEnum : ENUM8 { + enum NetworkCommissioningStatusEnum : enum8 { kSuccess = 0; kOutOfRange = 1; kBoundsExceeded = 2; @@ -852,7 +852,7 @@ server cluster NetworkCommissioning = 49 { kUnknownError = 12; } - enum WiFiBandEnum : ENUM8 { + enum WiFiBandEnum : enum8 { k2G4 = 0; k3G65 = 1; k5G = 2; @@ -861,13 +861,21 @@ server cluster NetworkCommissioning = 49 { k1G = 5; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kWiFiNetworkInterface = 0x1; kThreadNetworkInterface = 0x2; kEthernetNetworkInterface = 0x4; } - bitmap WiFiSecurityBitmap : BITMAP8 { + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { kUnencrypted = 0x1; kWEP = 0x2; kWPAPersonal = 0x4; @@ -976,7 +984,7 @@ server cluster NetworkCommissioning = 49 { /** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster GeneralDiagnostics = 51 { - enum BootReasonEnum : ENUM8 { + enum BootReasonEnum : enum8 { kUnspecified = 0; kPowerOnReboot = 1; kBrownOutReset = 2; @@ -986,7 +994,7 @@ server cluster GeneralDiagnostics = 51 { kSoftwareReset = 6; } - enum HardwareFaultEnum : ENUM8 { + enum HardwareFaultEnum : enum8 { kUnspecified = 0; kRadio = 1; kSensor = 2; @@ -1000,7 +1008,7 @@ server cluster GeneralDiagnostics = 51 { kTamperDetected = 10; } - enum InterfaceTypeEnum : ENUM8 { + enum InterfaceTypeEnum : enum8 { kUnspecified = 0; kWiFi = 1; kEthernet = 2; @@ -1008,14 +1016,14 @@ server cluster GeneralDiagnostics = 51 { kThread = 4; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kHardwareFailure = 1; kNetworkJammed = 2; kConnectionFailed = 3; } - enum RadioFaultEnum : ENUM8 { + enum RadioFaultEnum : enum8 { kUnspecified = 0; kWiFiFault = 1; kCellularFault = 2; @@ -1081,8 +1089,8 @@ server cluster GeneralDiagnostics = 51 { /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster SoftwareDiagnostics = 52 { - bitmap Feature : BITMAP32 { - kWaterMarks = 0x1; + bitmap Feature : bitmap32 { + kWatermarks = 0x1; } struct ThreadMetricsStruct { @@ -1110,24 +1118,24 @@ server cluster SoftwareDiagnostics = 52 { readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - command ResetWatermarks(): DefaultSuccess = 0; + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ server cluster ThreadNetworkDiagnostics = 53 { - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum NetworkFaultEnum : ENUM8 { + enum NetworkFaultEnum : enum8 { kUnspecified = 0; kLinkDown = 1; kHardwareFailure = 2; kNetworkJammed = 3; } - enum RoutingRoleEnum : ENUM8 { + enum RoutingRoleEnum : enum8 { kUnspecified = 0; kUnassigned = 1; kSleepyEndDevice = 2; @@ -1137,7 +1145,7 @@ server cluster ThreadNetworkDiagnostics = 53 { kLeader = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; kMLECounts = 0x4; @@ -1278,19 +1286,19 @@ server cluster ThreadNetworkDiagnostics = 53 { /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster WiFiNetworkDiagnostics = 54 { - enum AssociationFailureCauseEnum : ENUM8 { + enum AssociationFailureCauseEnum : enum8 { kUnknown = 0; kAssociationFailed = 1; kAuthenticationFailed = 2; kSsidNotFound = 3; } - enum ConnectionStatusEnum : ENUM8 { + enum ConnectionStatusEnum : enum8 { kConnected = 0; kNotConnected = 1; } - enum SecurityTypeEnum : ENUM8 { + enum SecurityTypeEnum : enum8 { kUnspecified = 0; kNone = 1; kWEP = 2; @@ -1299,7 +1307,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kWPA3 = 5; } - enum WiFiVersionEnum : ENUM8 { + enum WiFiVersionEnum : enum8 { kA = 0; kB = 1; kG = 2; @@ -1309,7 +1317,7 @@ server cluster WiFiNetworkDiagnostics = 54 { kAh = 6; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1352,7 +1360,7 @@ server cluster WiFiNetworkDiagnostics = 54 { /** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ server cluster EthernetNetworkDiagnostics = 55 { - enum PHYRateEnum : ENUM8 { + enum PHYRateEnum : enum8 { kRate10M = 0; kRate100M = 1; kRate1G = 2; @@ -1365,7 +1373,7 @@ server cluster EthernetNetworkDiagnostics = 55 { kRate400G = 9; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kPacketCounts = 0x1; kErrorCounts = 0x2; } @@ -1389,21 +1397,25 @@ server cluster EthernetNetworkDiagnostics = 55 { /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { - enum CommissioningWindowStatusEnum : ENUM8 { + enum CommissioningWindowStatusEnum : enum8 { kWindowNotOpen = 0; kEnhancedWindowOpen = 1; kBasicWindowOpen = 2; } - enum StatusCode : ENUM8 { + enum StatusCode : enum8 { kBusy = 2; kPAKEParameterError = 3; kWindowNotOpen = 4; } + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; readonly attribute nullable fabric_idx adminFabricIndex = 1; - readonly attribute nullable int16u adminVendorId = 2; + readonly attribute nullable vendor_id adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1416,7 +1428,7 @@ server cluster AdministratorCommissioning = 60 { octet_string PAKEPasscodeVerifier = 1; int16u discriminator = 2; int32u iterations = 3; - octet_string salt = 4; + octet_string<32> salt = 4; } request struct OpenBasicCommissioningWindowRequest { @@ -1430,12 +1442,12 @@ server cluster AdministratorCommissioning = 60 { /** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ server cluster OperationalCredentials = 62 { - enum CertificateChainTypeEnum : ENUM8 { + enum CertificateChainTypeEnum : enum8 { kDACCertificate = 1; kPAICertificate = 2; } - enum NodeOperationalCertStatusEnum : ENUM8 { + enum NodeOperationalCertStatusEnum : enum8 { kOK = 0; kInvalidPublicKey = 1; kInvalidNodeOpId = 2; @@ -1477,7 +1489,7 @@ server cluster OperationalCredentials = 62 { readonly attribute int16u clusterRevision = 65533; request struct AttestationRequestRequest { - octet_string attestationNonce = 0; + octet_string<32> attestationNonce = 0; } request struct CertificateChainRequestRequest { @@ -1485,14 +1497,14 @@ server cluster OperationalCredentials = 62 { } request struct CSRRequestRequest { - octet_string CSRNonce = 0; + octet_string<32> CSRNonce = 0; optional boolean isForUpdateNOC = 1; } request struct AddNOCRequest { - octet_string NOCValue = 0; - optional octet_string ICACValue = 1; - octet_string IPKValue = 2; + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; int64u caseAdminSubject = 3; vendor_id adminVendorId = 4; } @@ -1515,12 +1527,12 @@ server cluster OperationalCredentials = 62 { } response struct AttestationResponse = 1 { - octet_string attestationElements = 0; - octet_string attestationSignature = 1; + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; } response struct CertificateChainResponse = 3 { - octet_string certificate = 0; + octet_string<600> certificate = 0; } response struct CSRResponse = 5 { @@ -1531,7 +1543,7 @@ server cluster OperationalCredentials = 62 { response struct NOCResponse = 8 { NodeOperationalCertStatusEnum statusCode = 0; optional fabric_idx fabricIndex = 1; - optional char_string debugText = 2; + optional char_string<128> debugText = 2; } command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; @@ -1546,12 +1558,12 @@ server cluster OperationalCredentials = 62 { /** The Group Key Management Cluster is the mechanism by which group keys are managed. */ server cluster GroupKeyManagement = 63 { - enum GroupKeySecurityPolicyEnum : ENUM8 { + enum GroupKeySecurityPolicyEnum : enum8 { kTrustFirst = 0; kCacheAndSync = 1; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kCacheAndSync = 0x1; } @@ -1651,7 +1663,7 @@ server cluster UserLabel = 65 { /** Provides an interface for controlling and adjusting automatic window coverings. */ server cluster WindowCovering = 258 { - enum EndProductType : ENUM8 { + enum EndProductType : enum8 { kRollerShade = 0; kRomanShade = 1; kBalloonShade = 2; @@ -1679,7 +1691,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - enum Type : ENUM8 { + enum Type : enum8 { kRollerShade = 0; kRollerShade2Motor = 1; kRollerShadeExterior = 2; @@ -1693,7 +1705,7 @@ server cluster WindowCovering = 258 { kUnknown = 255; } - bitmap ConfigStatus : BITMAP8 { + bitmap ConfigStatus : bitmap8 { kOperational = 0x1; kOnlineReserved = 0x2; kLiftMovementReversed = 0x4; @@ -1703,7 +1715,7 @@ server cluster WindowCovering = 258 { kTiltEncoderControlled = 0x40; } - bitmap Feature : BITMAP32 { + bitmap Feature : bitmap32 { kLift = 0x1; kTilt = 0x2; kPositionAwareLift = 0x4; @@ -1711,20 +1723,20 @@ server cluster WindowCovering = 258 { kPositionAwareTilt = 0x10; } - bitmap Mode : BITMAP8 { + bitmap Mode : bitmap8 { kMotorDirectionReversed = 0x1; kCalibrationMode = 0x2; kMaintenanceMode = 0x4; kLedFeedback = 0x8; } - bitmap OperationalStatus : BITMAP8 { + bitmap OperationalStatus : bitmap8 { kGlobal = 0x3; kLift = 0xC; kTilt = 0x30; } - bitmap SafetyStatus : BITMAP16 { + bitmap SafetyStatus : bitmap16 { kRemoteLockout = 0x1; kTamperDetection = 0x2; kFailedCommunication = 0x4; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 024b9247c290ac..a5dcb3b1a3bc2e 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -4273,7 +4273,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -7057,5 +7057,6 @@ "endpointId": 2, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/window-app/nrfconnect/main/include/AppTask.h b/examples/window-app/nrfconnect/main/include/AppTask.h index b9f78d244d1cd5..fdd94d0c61e416 100644 --- a/examples/window-app/nrfconnect/main/include/AppTask.h +++ b/examples/window-app/nrfconnect/main/include/AppTask.h @@ -34,13 +34,10 @@ struct k_timer; struct Identify; -class AppFabricTableDelegate; class AppTask { public: - friend class AppFabricTableDelegate; - static AppTask & Instance(void) { static AppTask sAppTask; diff --git a/examples/window-app/silabs/include/CHIPProjectConfig.h b/examples/window-app/silabs/include/CHIPProjectConfig.h index f1a69277f06079..2ee5e8735b2192 100644 --- a/examples/window-app/silabs/include/CHIPProjectConfig.h +++ b/examples/window-app/silabs/include/CHIPProjectConfig.h @@ -129,5 +129,3 @@ * */ #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index 372dbcf8dba809..28dcc9aadd0ef6 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -24,7 +24,7 @@ for creating your own application. 2. Activate the build environment: ```bash - $ source ./scripts/activate.sh + $ source ./scripts/activate.sh -p all,telink ``` 3. In the example dir run (replace __ with your board name, for diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 808c882ef7ac1f..f2c73a5eb2cd17 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -6,7 +6,7 @@ steps: - "--init" - "--recursive" id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -21,7 +21,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -85,7 +85,7 @@ steps: --target k32w-shell build --create-archives /workspace/artifacts/ - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 488d05c19f4097..d0989a173705c7 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 2700s - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -27,7 +27,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 8db671765d7b83..ef5e12328b7181 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" git submodule update --init --recursive id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -22,7 +22,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -43,7 +43,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -64,7 +64,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -86,7 +86,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -139,7 +139,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:21" + - name: "ghcr.io/project-chip/chip-build-vscode:22" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 366e70bb2f0bce..3bc07693a047b5 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -21 : [chip-build-java] Ensure java is actually available in the docker image +24 : [nrfconnect] Update nRF Connect SDK version. diff --git a/integrations/docker/images/stage-2/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/stage-2/chip-build-nrf-platform/Dockerfile index b01028f4708310..86148668a86e0b 100644 --- a/integrations/docker/images/stage-2/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-nrf-platform/Dockerfile @@ -7,7 +7,7 @@ ARG VERSION=1 FROM ghcr.io/project-chip/chip-build:${VERSION} as build LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip # Compatible Nordic Connect SDK revision. -ARG NCS_REVISION=v2.4.0 +ARG NCS_REVISION=v2.5.0 SHELL ["/bin/bash", "-o", "pipefail", "-c"] WORKDIR /opt/NordicSemiconductor/nRF5_tools @@ -16,14 +16,14 @@ RUN set -x \ | tar zxvf - \ && tar xvf JLink_Linux_V780c_x86_64.tgz \ && rm JLink_Linux_V780c_x86_64.* \ - && curl --location https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.16.0_linux-x86_64_minimal.tar.xz \ - && tar xvf zephyr-sdk-0.16.0_linux-x86_64_minimal.tar.xz \ - && zephyr-sdk-0.16.0/setup.sh -t arm-zephyr-eabi \ + && curl --location https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ + && tar xvf zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ + && zephyr-sdk-0.16.1/setup.sh -t arm-zephyr-eabi \ && : # last line WORKDIR /opt/NordicSemiconductor/nrfconnect RUN set -x \ - && python3 -m pip install -U --no-cache-dir west==1.0.0 \ + && python3 -m pip install -U --no-cache-dir west==1.1.0 \ && west init -m https://github.com/nrfconnect/sdk-nrf --mr "$NCS_REVISION" \ && west config update.narrow true \ && west config update.fetch smart \ @@ -63,6 +63,6 @@ ENV LD_LIBRARY_PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V780c_x86_64:${LD_LIBRARY_PAT ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 ENV ZEPHYR_BASE=/opt/NordicSemiconductor/nrfconnect/zephyr -ENV ZEPHYR_SDK_INSTALL_DIR=${NRF5_TOOLS_ROOT}/zephyr-sdk-0.16.0 +ENV ZEPHYR_SDK_INSTALL_DIR=${NRF5_TOOLS_ROOT}/zephyr-sdk-0.16.1 ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr ENV ZEPHYR_TOOLCHAIN_PATH=${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi diff --git a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile index 018344aa4378e6..1310e0a12f9add 100644 --- a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile @@ -2,34 +2,20 @@ ARG VERSION=1 FROM ghcr.io/project-chip/chip-build:${VERSION} as build LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip -RUN set -x \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/ \ - && : # last line - # Setup toolchain +WORKDIR /opt/telink RUN set -x \ - && mkdir /opt/telink \ - && cd /opt/telink \ - && wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ - && wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/sha256.sum | shasum --check --ignore-missing \ + && curl --location https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ && tar xvf zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ && rm -rf zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \ - && cd zephyr-sdk-0.16.1 \ - && ./setup.sh -t riscv64-zephyr-elf -h -c \ - && cd / \ + && zephyr-sdk-0.16.1/setup.sh -t riscv64-zephyr-elf \ && : # last line # Setup Zephyr ARG ZEPHYR_REVISION=5e5f3cfde3fb5070b2e6cfb8ab08bc688b5aa3d4 WORKDIR /opt/telink/zephyrproject RUN set -x \ - && python3 -m pip install -U --no-cache-dir \ - west==1.0.0 \ - imgtool==1.7.0 \ + && python3 -m pip install -U --no-cache-dir west \ && git clone https://github.com/telink-semi/zephyr \ && cd zephyr \ && git reset ${ZEPHYR_REVISION} --hard \ @@ -41,45 +27,16 @@ RUN set -x \ && : # last line FROM ghcr.io/project-chip/chip-build:${VERSION} -LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip COPY --from=build /opt/telink/zephyr-sdk-0.16.1/ /opt/telink/zephyr-sdk-0.16.1/ COPY --from=build /opt/telink/zephyrproject/ /opt/telink/zephyrproject/ -ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr -ENV ZEPHYR_SDK_INSTALL_DIR=/opt/telink/zephyr-sdk-0.16.1 - RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - ccache \ - dfu-util=0.9-1 \ - device-tree-compiler \ - gcc-multilib \ - g++-multilib \ - libsdl2-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ - && python3 -m pip install -U --no-cache-dir \ - pyelftools==0.27 \ && pip3 install --no-cache-dir --user -r /opt/telink/zephyrproject/zephyr/scripts/requirements.txt \ && : # last line -# Setup Telink tools required for "west flash" -ARG TELINK_TOOLS_BASE=/opt/telink/tools -RUN wget http://wiki.telink-semi.cn/tools_and_sdk/Tools/IDE/telink_riscv_ice_flash_tool.zip -O /opt/telink/tools.zip \ - && unzip /opt/telink/tools.zip -d ${TELINK_TOOLS_BASE} \ - && rm /opt/telink/tools.zip \ - && mv ${TELINK_TOOLS_BASE}/telink_riscv_linux_toolchain/* ${TELINK_TOOLS_BASE} \ - && rm -rf ${TELINK_TOOLS_BASE}/telink_riscv_linux_toolchain \ - && chmod +x ${TELINK_TOOLS_BASE}/flash/bin/SPI_burn \ - && chmod +x ${TELINK_TOOLS_BASE}/ice/ICEman \ - && : # last line - -# Add path to Telink tools -ENV PATH="${TELINK_TOOLS_BASE}/flash/bin:${PATH}" -ENV PATH="${TELINK_TOOLS_BASE}/ice:${PATH}" - -ARG ZEPHYR_PROJECT_DIR=/opt/telink/zephyrproject -ENV TELINK_ZEPHYR_BASE=${ZEPHYR_PROJECT_DIR}/zephyr -ENV ZEPHYR_BASE=${ZEPHYR_PROJECT_DIR}/zephyr +ENV TELINK_ZEPHYR_BASE=/opt/telink/zephyrproject/zephyr +ENV TELINK_ZEPHYR_SDK_DIR=/opt/telink/zephyr-sdk-0.16.1 diff --git a/integrations/docker/images/stage-2/chip-build-ti/Dockerfile b/integrations/docker/images/stage-2/chip-build-ti/Dockerfile index 0cc77621bde754..4bc15b67f77164 100644 --- a/integrations/docker/images/stage-2/chip-build-ti/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-ti/Dockerfile @@ -12,9 +12,9 @@ RUN set -x \ # Install Sysconfig RUN set -x \ - && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run \ - && chmod +x sysconfig-1.15.0_2826-setup.run \ - && ./sysconfig-1.15.0_2826-setup.run --mode unattended \ + && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.16.2.3028/sysconfig-1.16.2_3028-setup.run \ + && chmod +x sysconfig-1.16.2_3028-setup.run \ + && ./sysconfig-1.16.2_3028-setup.run --mode unattended \ && : # last line -ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.15.0 +ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.16.2 diff --git a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile index d824716800004e..8ca2f980f0cf6f 100644 --- a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile @@ -52,7 +52,7 @@ COPY --from=k32w /opt/sdk /opt/k32w COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland -COPY --from=ti /opt/ti/sysconfig_1.15.0 /opt/ti/sysconfig_1.15.0 +COPY --from=ti /opt/ti/sysconfig_1.16.2 /opt/ti/sysconfig_1.16.2 COPY --from=openiotsdk /opt/FVP_Corstone_SSE-300/ /opt/FVP_Corstone_SSE-300/ @@ -120,9 +120,9 @@ ENV QEMU_ESP32_DIR=/opt/espressif/qemu ENV SYSROOT_AARCH64=/opt/ubuntu-22.04.1-aarch64-sysroot ENV TELINK_ZEPHYR_BASE=/opt/telink/zephyrproject/zephyr ENV TELINK_ZEPHYR_SDK_DIR=/opt/telink/zephyr-sdk-0.16.1 -ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.15.0 +ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.16.2 ENV ZEPHYR_BASE=/opt/NordicSemiconductor/nrfconnect/zephyr -ENV ZEPHYR_SDK_INSTALL_DIR=/opt/NordicSemiconductor/nRF5_tools/zephyr-sdk-0.16.0 +ENV ZEPHYR_SDK_INSTALL_DIR=/opt/NordicSemiconductor/nRF5_tools/zephyr-sdk-0.16.1 ENV ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb ENV TIZEN_VERSION 7.0 diff --git a/kotlin-detect-config.yaml b/kotlin-detect-config.yaml index b5d9c53b5949bc..f9765e5eb11e3e 100644 --- a/kotlin-detect-config.yaml +++ b/kotlin-detect-config.yaml @@ -155,6 +155,7 @@ style: - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/EnterNetworkFragment.kt" - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/MatterCommand.kt" - "**/src/controller/java/src/matter/onboardingpayload/Base38.kt" + - "**/src/controller/java/generated/java/**/*" ForbiddenComment: excludes: - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" @@ -246,6 +247,9 @@ naming: excludes: - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommandAdapter.kt" - "**/src/controller/java/generated/java/**/*" + FunctionParameterNaming: + excludes: + - "**/src/controller/java/generated/java/**/*" TopLevelPropertyNaming: excludes: - "**/src/controller/java/generated/java/**/*" diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index fb5e92fb38ca0f..2160af0d1e0322 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -135,6 +135,7 @@ def BuildHostTarget(): TargetPart('dishwasher', app=HostApp.DISHWASHER), TargetPart('refrigerator', app=HostApp.REFRIGERATOR), TargetPart('rvc', app=HostApp.RVC), + TargetPart('air-purifier', app=HostApp.AIR_PURIFIER), ] if (HostBoard.NATIVE.PlatformName() == 'darwin'): @@ -534,6 +535,7 @@ def Buildcc32xxTarget(): # apps target.AppendFixedTargets([ TargetPart('lock', app=cc32xxApp.LOCK), + TargetPart('air-purifier', app=cc32xxApp.AIR_PURIFIER), ]) @@ -615,6 +617,7 @@ def BuildTizenTarget(): target.AppendModifier("no-wifi", enable_wifi=False) target.AppendModifier("asan", use_asan=True) target.AppendModifier("ubsan", use_ubsan=True) + target.AppendModifier('with-ui', with_ui=True) return target @@ -655,6 +658,7 @@ def BuildBouffalolabTarget(): target.AppendModifier('thread', enable_thread=True) target.AppendModifier('fp', enable_frame_ptr=True) target.AppendModifier('memmonitor', enable_heap_monitoring=True) + target.AppendModifier('mot', use_matter_openthread=True) return target diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index a6f2186da6e1e7..b5d2f1834c5ddb 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -97,6 +97,8 @@ def AppGnArgs(self): gn_args["chip_config_network_layer_ble"] = False elif self == AndroidApp.VIRTUAL_DEVICE_APP: gn_args["chip_config_network_layer_ble"] = True + elif self == AndroidApp.CHIP_TOOL: + gn_args["chip_build_controller_dynamic_server"] = True return gn_args def ExampleName(self): diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index f6424e977b3d56..c4d4fc10f12ccd 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -91,7 +91,8 @@ def __init__(self, enable_wifi: bool = False, enable_thread: bool = False, enable_frame_ptr: bool = False, - enable_heap_monitoring: bool = False + enable_heap_monitoring: bool = False, + use_matter_openthread: bool = False ): if 'BL602' == module_type: @@ -166,6 +167,9 @@ def __init__(self, if enable_thread: self.argsOpt.append(f'openthread_project_core_config_file="{bouffalo_chip}-openthread-core-bl-config.h"') + if not use_matter_openthread: + self.argsOpt.append( + 'openthread_root="//third_party/connectedhomeip/third_party/bouffalolab/repo/components/network/thread/openthread"') if enable_cdc: if bouffalo_chip != "bl702": diff --git a/scripts/build/builders/cc32xx.py b/scripts/build/builders/cc32xx.py index 7685b6a66af0fd..f54b7531eecc81 100644 --- a/scripts/build/builders/cc32xx.py +++ b/scripts/build/builders/cc32xx.py @@ -20,16 +20,21 @@ class cc32xxApp(Enum): LOCK = auto() + AIR_PURIFIER = auto() def ExampleName(self): if self == cc32xxApp.LOCK: return 'lock-app' + elif self == cc32xxApp.AIR_PURIFIER: + return 'air-purifier-app' else: raise Exception('Unknown app type: %r' % self) def AppNamePrefix(self): if self == cc32xxApp.LOCK: return 'chip-CC3235SF_LAUNCHXL-lock-example' + elif self == cc32xxApp.AIR_PURIFIER: + return 'chip-CC3235SF_LAUNCHXL-air-purifier-example' else: raise Exception('Unknown app type: %r' % self) @@ -60,6 +65,8 @@ def build_outputs(self): items = {} if (self.app == cc32xxApp.LOCK): extensions = [".out", ".bin", ".out.map"] + elif (self.app == cc32xxApp.AIR_PURIFIER): + extensions = [".out", ".bin", ".out.map"] else: raise Exception('Unknown app type: %r' % self.app) diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index fcc159894bda29..2a145906e54087 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -72,6 +72,7 @@ class HostApp(Enum): DISHWASHER = auto() REFRIGERATOR = auto() RVC = auto() + AIR_PURIFIER = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -124,6 +125,8 @@ def ExamplePath(self): return 'refrigerator-app/linux' elif self == HostApp.RVC: return 'rvc-app/linux' + elif self == HostApp.AIR_PURIFIER: + return 'air-purifier-app/linux' else: raise Exception('Unknown app type: %r' % self) @@ -215,6 +218,9 @@ def OutputNames(self): elif self == HostApp.RVC: yield 'rvc-app' yield 'rvc-app.map' + elif self == HostApp.AIR_PURIFIER: + yield 'air-purifier-app' + yield 'air-purifier-app.map' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index 966b5da62207de..bc0a454b39222c 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -93,6 +93,7 @@ def __init__(self, use_asan: bool = False, use_tsan: bool = False, use_ubsan: bool = False, + with_ui: bool = False, ): super(TizenBuilder, self).__init__( root=os.path.join(root, app.value.source), @@ -128,6 +129,8 @@ def __init__(self, raise Exception("TSAN sanitizer not supported by Tizen toolchain") if use_ubsan: self.extra_gn_options.append('is_ubsan=true') + if with_ui: + self.extra_gn_options.append('chip_examples_enable_ui=true') def GnBuildArgs(self): # Make sure that required ENV variables are defined diff --git a/scripts/build/test.py b/scripts/build/test.py index c89a4d98109357..f684ace074d5ca 100644 --- a/scripts/build/test.py +++ b/scripts/build/test.py @@ -48,6 +48,7 @@ def build_actual_output(root: str, out: str, args: List[str]) -> List[str]: 'IMX_SDK_ROOT': 'IMX_SDK_ROOT', 'TI_SYSCONFIG_ROOT': 'TEST_TI_SYSCONFIG_ROOT', 'JAVA_PATH': 'TEST_JAVA_PATH', + 'GSDK_ROOT': 'TEST_GSDK_ROOT', }) retval = subprocess.run([ diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 7ed9c674b978f3..b5402ab140189a 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,8 +1,8 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher,refrigerator}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio] android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller,kotlin-matter-controller,virtual-device-app}[-no-debug] -bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp][-memmonitor] -cc32xx-lock +bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp][-memmonitor][-mot] +cc32xx-{lock,air-purifier} ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd] ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd] cyw30739-cyw930739m2evb_01-{light,lock,ota-requestor,switch} @@ -10,7 +10,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,refrigerator,rvc}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,refrigerator,rvc,air-purifier}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] @@ -21,6 +21,6 @@ nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,loc nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light -tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] +tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] telink-{tlsr9518adk80d,tlsr9528a}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt index 41de17332bd7e7..c2810269aa0f57 100644 --- a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt +++ b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt @@ -8,7 +8,7 @@ python3 third_party/android_deps/set_up_android_deps.py third_party/java_deps/set_up_java_deps.sh # Generating android-arm64-chip-tool -gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" ' +gn gen --check --fail-on-unused-args {out}/android-arm64-chip-tool '--args=target_os="android" target_cpu="arm64" android_ndk_root="TEST_ANDROID_NDK_HOME" android_sdk_root="TEST_ANDROID_HOME" chip_build_controller_dynamic_server=true ' # Accepting NDK licenses @ tools bash -c 'yes | TEST_ANDROID_HOME/tools/bin/sdkmanager --licenses >/dev/null' diff --git a/scripts/build/testdata/dry_run_efr32-brd4161a-light-rpc-no-version.txt b/scripts/build/testdata/dry_run_efr32-brd4161a-light-rpc-no-version.txt index 309cdd49b9f256..b96ccbc89ea97e 100644 --- a/scripts/build/testdata/dry_run_efr32-brd4161a-light-rpc-no-version.txt +++ b/scripts/build/testdata/dry_run_efr32-brd4161a-light-rpc-no-version.txt @@ -2,7 +2,7 @@ cd "{root}" # Generating efr32-brd4161a-light-rpc-no-version -gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/silabs '--args=silabs_board="BRD4161A" is_debug=false import("//with_pw_rpc.gni")' {out}/efr32-brd4161a-light-rpc-no-version +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/silabs '--args=silabs_board="BRD4161A" is_debug=false import("//with_pw_rpc.gni") efr32_sdk_root="TEST_GSDK_ROOT" openthread_root="TEST_GSDK_ROOT/util/third_party/openthread"' {out}/efr32-brd4161a-light-rpc-no-version # Building efr32-brd4161a-light-rpc-no-version ninja -C {out}/efr32-brd4161a-light-rpc-no-version diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 484788eb4baf28..174985b376d117 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -36,7 +36,7 @@ USE_GIT_SHA_FOR_VERSION=true USE_SLC=false GN_PATH=gn GN_PATH_PROVIDED=false - +USE_BOOTLOADER=false DOTFILE=".gn" SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\" @@ -138,6 +138,9 @@ if [ "$#" == "0" ]; then Generate files with SLC for current board and options Requires an SLC-CLI installation or running in Docker. --slc_reuse_files Use generated files without running slc again. + --bootloader + Add bootloader to the generated image. + " elif [ "$#" -lt "2" ]; then @@ -218,6 +221,10 @@ else optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " shift ;; + --bootloader) + USE_BOOTLOADER=true + shift + ;; --docker) optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " USE_DOCKER=true @@ -327,4 +334,44 @@ else #print stats arm-none-eabi-size -A "$BUILD_DIR"/*.out + # add bootloader to generated image + if [ "$USE_BOOTLOADER" == true ]; then + + binName="" + InternalBootloaderBoards=("BRD4337A" "BRD2704A" "BRD2703A" "BRD4319A") + bootloaderPath="" + commanderPath="" + # find the matter root folder + if [ -z "$MATTER_ROOT" ]; then + MATTER_ROOT="$CHIP_ROOT" + fi + + # set commander path + if [ -z "$COMMANDER_PATH" ]; then + commanderPath="commander" + else + commanderPath="$COMMANDER_PATH" + fi + + # search bootloader directory for the respective bootloaders for the input board + bootloaderFiles=("$(find "$MATTER_ROOT/third_party/silabs/matter_support/matter/efr32/bootloader_binaries/" -maxdepth 1 -name "*$SILABS_BOARD*" | tr '\n' ' ')") + + if [ "${#bootloaderFiles[@]}" -gt 1 ]; then + for i in "${!bootloaderFiles[@]}"; do + # if a variant of the bootloader that uses external flash exists, use that one. + if [[ "${bootloaderFiles[$i]}" =~ .*"spiflash".* ]]; then + bootloaderPath="${bootloaderFiles[$i]}" + break + fi + done + elif [ "${#bootloaderFiles[@]}" -eq 0 ]; then + echo "A bootloader for the $SILABS_BOARD currently doesn't exist!" + else + bootloaderPath="${bootloaderFiles[0]}" + fi + echo "$bootloaderPath" + binName="$(find "$BUILD_DIR" -type f -name "*.s37")" + echo "$binName" + "$commanderPath" convert "$binName" "$bootloaderPath" -o "$binName" + fi fi diff --git a/scripts/py_matter_idl/BUILD.gn b/scripts/py_matter_idl/BUILD.gn index 81f5be3be554b4..37b17477aabfbc 100644 --- a/scripts/py_matter_idl/BUILD.gn +++ b/scripts/py_matter_idl/BUILD.gn @@ -44,6 +44,10 @@ pw_python_package("matter_idl") { "matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp", "matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp", "matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp", + "matter_idl/tests/outputs/several_clusters/java/ChipClusters.java", + "matter_idl/tests/outputs/several_clusters/java/ChipEventStructs.java", + "matter_idl/tests/outputs/several_clusters/java/ChipStructs.java", + "matter_idl/tests/outputs/several_clusters/java/ClusterInfoMapping.java", "matter_idl/tests/outputs/several_clusters/java/ClusterIDMapping.java", "matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java", "matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp", @@ -62,7 +66,8 @@ pw_python_package("matter_idl") { "matter_idl/test_backwards_compatibility.py", "matter_idl/test_matter_idl_parser.py", "matter_idl/test_generators.py", - "matter_idl/test_xml_parser.py", + "matter_idl/test_idl_generator.py", + "matter_idl/test_zapxml.py", ] # TODO: at a future time consider enabling all (* or missing) here to get diff --git a/scripts/py_matter_idl/files.gni b/scripts/py_matter_idl/files.gni index 84680a8863d42f..dab10a26bffbdc 100644 --- a/scripts/py_matter_idl/files.gni +++ b/scripts/py_matter_idl/files.gni @@ -7,6 +7,7 @@ matter_idl_generator_templates = [ "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/application/PluginApplicationCallbacksHeader.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/tlvmeta/TLVMetaData_cpp.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/tlvmeta/TLVMetaData_h.jinja", + "${chip_root}/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/CHIPCallbackTypes.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja", @@ -22,11 +23,19 @@ matter_idl_generator_templates = [ matter_idl_generator_sources = [ "${chip_root}/scripts/py_matter_idl/matter_idl/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/backwards_compatibility.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/__init__.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/__init__.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/base.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/context.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/derivation.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/parsing.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/application/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/cpp/tlvmeta/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/filters.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/generators/idl/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/registry.py", "${chip_root}/scripts/py_matter_idl/matter_idl/generators/types.py", @@ -36,16 +45,17 @@ matter_idl_generator_sources = [ "${chip_root}/scripts/py_matter_idl/matter_idl/matter_idl_parser.py", "${chip_root}/scripts/py_matter_idl/matter_idl/matter_idl_types.py", "${chip_root}/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/test_data_model_xml.py", "${chip_root}/scripts/py_matter_idl/matter_idl/test_generators.py", "${chip_root}/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py", - "${chip_root}/scripts/py_matter_idl/matter_idl/test_xml_parser.py", - "${chip_root}/scripts/py_matter_idl/matter_idl/xml_parser.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/test_zapxml.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/handlers/__init__.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/handlers/base.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/handlers/context.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py", "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml/handlers/parsing.py", + "${chip_root}/scripts/py_matter_idl/matter_idl/zapxml_parser.py", ] # All the files that the matter idl infrastructure will use diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/__init__.py b/scripts/py_matter_idl/matter_idl/data_model_xml/__init__.py new file mode 100644 index 00000000000000..fb0a0cf8d516a9 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/__init__.py @@ -0,0 +1,128 @@ +# Copyright (c) 2022 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 logging +import typing +import xml.sax.handler +from dataclasses import dataclass +from typing import List, Optional, Union + +from matter_idl.data_model_xml.handlers import Context, DataModelXmlHandler +from matter_idl.matter_idl_types import Idl + + +class ParseHandler(xml.sax.handler.ContentHandler): + """A parser for data model XML data definitions. + + Defers its processing to DataModelXmlHandler and keeps track of: + - an internal context for all handlers + - the parsed Idl structure that is incrementally built + - sets up parsing location within the context + - keeps track of ParsePath + + Overall converts a python SAX handler into matter_idl.zapxml.handlers + """ + + def __init__(self, include_meta_data=True): + super().__init__() + self._idl = Idl() + self._processing_stack = [] + # Context persists across all + self._context = Context() + self._include_meta_data = include_meta_data + self._locator = None + + def PrepareParsing(self, filename): + # This is a bit ugly: filename keeps changing during parse + # IDL meta is not prepared for this (as source is XML and .matter is + # single file) + if self._include_meta_data: + self._idl.parse_file_name = filename + + self._context.file_name = filename + + def Finish(self) -> Idl: + self._context.PostProcess(self._idl) + return self._idl + + def startDocument(self): + if self._include_meta_data and self._locator: + self._context.locator = self._locator + self._processing_stack = [ + DataModelXmlHandler(self._context, self._idl)] + + def endDocument(self): + if len(self._processing_stack) != 1: + raise Exception("Unexpected nesting!") + + def startElement(self, name: str, attrs): + logging.debug("ELEMENT START: %r / %r" % (name, attrs)) + self._context.path.push(name) + self._processing_stack.append( + self._processing_stack[-1].GetNextProcessor(name, attrs)) + + def endElement(self, name: str): + logging.debug("ELEMENT END: %r" % name) + + last = self._processing_stack.pop() + last.EndProcessing() + + # important to pop AFTER processing end to allow processing + # end to access the current context + self._context.path.pop() + + def characters(self, content): + self._processing_stack[-1].HandleContent(content) + + +@dataclass +class ParseSource: + """Represents an input sopurce for ParseXmls. + + Allows for named data sources to be parsed. + """ + source: Union[str, typing.IO] # filename or stream + # actual filename to use, None if the source is a filename already + name: Optional[str] = None + + @ property + def source_file_name(self): + if self.name: + return self.name + return self.source # assume string + + +def ParseXmls(sources: List[ParseSource], include_meta_data=True) -> Idl: + """Parse one or more XML inputs and return the resulting Idl data. + + Params: + sources - what to parse + include_meta_data - if parsing location data should be included in the Idl + """ + handler = ParseHandler(include_meta_data=include_meta_data) + + for source in sources: + logging.info('Parsing %s...' % source.source_file_name) + handler.PrepareParsing(source.source_file_name) + + parser = xml.sax.make_parser() + parser.setContentHandler(handler) + try: + parser.parse(source.source) + except AssertionError as e: + logging.error("AssertionError %s at %r", e, + handler._context.GetCurrentLocationMeta()) + raise + + return handler.Finish() diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/__init__.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/__init__.py new file mode 100644 index 00000000000000..b1ece298a904db --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/__init__.py @@ -0,0 +1,51 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from xml.sax.xmlreader import AttributesImpl + +from matter_idl.matter_idl_types import Idl + +from .base import BaseHandler +from .context import Context +from .handlers import ClusterHandler +from .parsing import NormalizeName + +LOGGER = logging.getLogger('data-model-xml-data-parsing') + + +def contains_valid_cluster_id(attrs: AttributesImpl) -> bool: + # Does not check numeric format ... assuming scraper is smart enough for that + return 'id' in attrs and len(attrs['id']) > 0 + + +class DataModelXmlHandler(BaseHandler): + """Handles the top level (/) of a data model xml file + """ + + def __init__(self, context: Context, idl: Idl): + super().__init__(context) + self._idl = idl + + def GetNextProcessor(self, name, attrs: AttributesImpl): + if name.lower() == 'cluster': + if contains_valid_cluster_id(attrs): + return ClusterHandler.ForAttributes(self.context, self._idl, attrs) + + LOGGER.info( + "Found an abstract base cluster (no id): '%s'", attrs['name']) + + return ClusterHandler.IntoCluster(self.context, self._idl, self.context.AddAbstractBaseCluster(NormalizeName(attrs['name']), self.context.GetCurrentLocationMeta())) + else: + return BaseHandler(self.context) diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/base.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/base.py new file mode 100644 index 00000000000000..c446a2e4bb43d1 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/base.py @@ -0,0 +1,63 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import enum + +from .context import Context + + +class HandledDepth: + """Defines how deep a XML element has been handled.""" + NOT_HANDLED = enum.auto() # Unknown/parsed element + ENTIRE_TREE = enum.auto() # Entire tree can be ignored + SINGLE_TAG = enum.auto() # Single tag processed, but not sub-items + + +class BaseHandler: + """A generic element handler. + + XML processing is done in the form of depth-first processing: + - Tree is descended into using `GetNextProcessor` + - Processors are expected to extend `BaseHandler` and allow for: + - GetNextProcessor to recurse + - HandleContent in case the text content is relevant + - EndProcessing once the entire tree has been walked (when xml element ends) + + BaseHandler keeps track if it has been handled or ot by its `_handled` setting and + init parameter. Non-handled elements will be tagged within the context, resulting + in logs. This is to detect if unknown/new tags appear in XML files. + """ + + def __init__(self, context: Context, handled=HandledDepth.NOT_HANDLED): + self.context = context + self._handled = handled + + def GetNextProcessor(self, name, attrs): + """Get the next processor to use for the given name""" + + if self._handled == HandledDepth.SINGLE_TAG: + handled = HandledDepth.NOT_HANDLED + else: + handled = self._handled + + return BaseHandler(context=self.context, handled=handled) + + def HandleContent(self, content): + """Processes some content""" + pass + + def EndProcessing(self): + """Finalizes the processing of the current element""" + if self._handled == HandledDepth.NOT_HANDLED: + self.context.MarkTagNotHandled() diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/context.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/context.py new file mode 100644 index 00000000000000..fe96836da37463 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/context.py @@ -0,0 +1,136 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +import xml.sax.xmlreader +from typing import List, Optional + +from matter_idl.matter_idl_types import Cluster, ClusterSide, Idl, ParseMetaData + + +class IdlPostProcessor: + """Defines a callback that will apply after an entire parsing + is complete. + """ + + def FinalizeProcessing(self, idl: Idl): + """Update idl with any post-processing directives.""" + pass + + +class ProcessingPath: + """Maintains the current path of tags within xml processing. + + As processing descents into an xml like `....` + paths will have contents like ['configurator', 'cluster', ...]. + + The main purpose for this is to log and keep track of what was visited + and in general to report things like 'this path found but was not handled'. + """ + + def __init__(self, paths: Optional[List[str]] = None): + if paths is None: + paths = [] + self.paths = paths + + def push(self, name: str): + self.paths.append(name) + + def pop(self): + self.paths.pop() + + def __str__(self): + return '::'.join(self.paths) + + def __repr__(self): + return 'ProcessingPath(%r)' % self.paths + + +class Context: + """ + Contains a processing state during XML reading. + + The purpose of this is to allow elements to interact with each other, share + data and defer processing. + + Usage: + - globally shared data: + > locator: parsing location, for error reporting + > path: current ProcessingPath for any logging of where we are located + - post-processing support: + > can register AddIdlPostProcessor to perform some processing once + a full parsing pass has been done + + More data may be added in time if it involves separate XML parse handlers + needing to interact with each other. + """ + + def __init__(self, locator: Optional[xml.sax.xmlreader.Locator] = None): + self.path = ProcessingPath() + self.locator = locator + self.file_name = None + self._not_handled: set[str] = set() + self._idl_post_processors: list[IdlPostProcessor] = [] + self.abstract_base_clusters: dict[str, Cluster] = {} + + def AddAbstractBaseCluster(self, name: str, parse_meta: Optional[ParseMetaData] = None) -> Cluster: + """Creates a new cluster entry for the given name in the list of known + base clusters. + """ + assert name not in self.abstract_base_clusters # be unique + + cluster = Cluster(side=ClusterSide.CLIENT, name=name, + code=-1, parse_meta=parse_meta) + self.abstract_base_clusters[name] = cluster + + return cluster + + def GetCurrentLocationMeta(self) -> Optional[ParseMetaData]: + if not self.locator: + return None + + return ParseMetaData(line=self.locator.getLineNumber(), column=self.locator.getColumnNumber()) + + def ParseLogLocation(self) -> Optional[str]: + if not self.file_name: + return None + meta = self.GetCurrentLocationMeta() + if not meta: + return None + + return f"{self.file_name}:{meta.line}:{meta.column}" + + def MarkTagNotHandled(self): + path = str(self.path) + if path not in self._not_handled: + msg = "TAG %s was not handled/recognized" % path + + where = self.ParseLogLocation() + if where: + msg = msg + " at " + where + + logging.warning(msg) + self._not_handled.add(path) + + def AddIdlPostProcessor(self, processor: IdlPostProcessor, has_priority: bool = False): + if has_priority: + self._idl_post_processors.insert(0, processor) + else: + self._idl_post_processors.append(processor) + + def PostProcess(self, idl: Idl): + for p in self._idl_post_processors: + p.FinalizeProcessing(idl) + + self._idl_post_processors = [] diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/derivation.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/derivation.py new file mode 100644 index 00000000000000..ff4bd9ddc664c8 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/derivation.py @@ -0,0 +1,173 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import logging +from typing import Iterable, Optional, Protocol, TypeVar + +from matter_idl.matter_idl_types import Attribute, Bitmap, Cluster, Command, Enum, Event, Idl, Struct + +from .context import Context, IdlPostProcessor +from .parsing import NormalizeName + +LOGGER = logging.getLogger('data-model-xml-data-parsing') + +T = TypeVar("T") + + +class HasName(Protocol): + name: str + + +NAMED = TypeVar('NAMED', bound=HasName) + + +def get_item_with_name(items: Iterable[NAMED], name: str) -> Optional[NAMED]: + """Find an item with the given name. + + Returns none if that item does not exist + """ + for item in items: + if item.name == name: + return item + return None + + +def merge_enum_into(e: Enum, cluster: Cluster): + existing = get_item_with_name(cluster.enums, e.name) + + if existing: + # Remove existing but merge constants into e + cluster.enums.remove(existing) + for value in existing.entries: + if not get_item_with_name(e.entries, value.name): + e.entries.append(value) + + cluster.enums.append(e) + + +def merge_bitmap_into(b: Bitmap, cluster: Cluster): + existing = get_item_with_name(cluster.bitmaps, b.name) + + if existing: + # Remove existing but merge constants into e + cluster.bitmaps.remove(existing) + for value in existing.entries: + if not get_item_with_name(b.entries, value.name): + b.entries.append(value) + + cluster.bitmaps.append(b) + + +def merge_event_into(e: Event, cluster: Cluster): + existing = get_item_with_name(cluster.events, e.name) + if existing: + LOGGER.error("TODO: Do not know how to merge event for %s::%s", + cluster.name, existing.name) + cluster.events.remove(existing) + + cluster.events.append(e) + + +def merge_attribute_into(a: Attribute, cluster: Cluster): + existing: Optional[Attribute] = None + for existing_a in cluster.attributes: + if existing_a.definition.name == a.definition.name: + existing = existing_a + break + + if existing: + # Do not provide merging as it seems only conformance is changed from + # the base cluster + # + # This should fix the correct types + # + # LOGGER.error("TODO: Do not know how to merge attribute for %s::%s", cluster.name, existing.definition.name) + cluster.attributes.remove(existing) + + cluster.attributes.append(a) + + +def merge_struct_into(s: Struct, cluster: Cluster): + existing = get_item_with_name(cluster.structs, s.name) + if existing: + # Do not provide merging as it seems XML only adds + # constraints and conformance to struct elements + # + # TODO: at some point we may be able to merge some things, + # if we find that derived clusters actually add useful things here + # + # LOGGER.error("TODO: Do not know how to merge structs for %s::%s", cluster.name, existing.name) + cluster.structs.remove(existing) + + cluster.structs.append(s) + + +def merge_command_into(c: Command, cluster: Cluster): + existing = get_item_with_name(cluster.commands, c.name) + + if existing: + LOGGER.error("TODO: Do not know how to merge command for %s::%s", + cluster.name, existing.name) + cluster.commands.remove(existing) + + cluster.commands.append(c) + + +def inherit_cluster_data(from_cluster: Cluster, into_cluster: Cluster): + for e in from_cluster.enums: + merge_enum_into(e, into_cluster) + + for b in from_cluster.bitmaps: + merge_bitmap_into(b, into_cluster) + + for ev in from_cluster.events: + merge_event_into(ev, into_cluster) + + for a in from_cluster.attributes: + merge_attribute_into(a, into_cluster) + + for s in from_cluster.structs: + merge_struct_into(s, into_cluster) + + for c in from_cluster.commands: + merge_command_into(c, into_cluster) + + +class AddBaseInfoPostProcessor(IdlPostProcessor): + def __init__(self, destination_cluster: Cluster, source_cluster_name: str, context: Context): + self.destination = destination_cluster + self.source_name = NormalizeName(source_cluster_name) + self.context = context + + def FinalizeProcessing(self, idl: Idl): + # attempt to find the base. It may be in the "names without ID" however it may also be inside + # existing clusters (e.g. Basic Information) + base: Optional[Cluster] = None + if self.source_name in self.context.abstract_base_clusters: + base = self.context.abstract_base_clusters[self.source_name] + else: + for c in idl.clusters: + if c.name == self.source_name: + base = c + break + + if not base: + LOGGER.error( + "Could not find the base cluster named '%s'", self.source_name) + return + + LOGGER.info("Copying base data from '%s' into '%s'", + base.name, self.destination.name) + inherit_cluster_data(from_cluster=base, into_cluster=self.destination) diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py new file mode 100644 index 00000000000000..0cae26bf5207ec --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py @@ -0,0 +1,616 @@ +# Copyright (c) 2023 Project CHIP +# +# 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 enum +import logging +from typing import Optional +from xml.sax.xmlreader import AttributesImpl + +from matter_idl.matter_idl_types import (ApiMaturity, Attribute, AttributeQuality, Bitmap, Cluster, ClusterSide, Command, + CommandQuality, ConstantEntry, DataType, Enum, Field, FieldQuality, Idl, Struct, StructTag) + +from .base import BaseHandler, HandledDepth +from .context import Context +from .derivation import AddBaseInfoPostProcessor +from .parsing import (ApplyConstraint, AttributesToAttribute, AttributesToBitFieldConstantEntry, AttributesToCommand, + AttributesToEvent, AttributesToField, NormalizeDataType, NormalizeName, ParseInt, StringToAccessPrivilege) + +LOGGER = logging.getLogger('data-model-xml-parser') + + +def is_unused_name(attrs: AttributesImpl): + """Existing XML adds various entries for base/derived reserved items. + + Those items seem to have no actual meaning. + + https://github.com/csa-data-model/projects/issues/363 + """ + if 'name' not in attrs: + return False + + return attrs['name'] in {'base reserved', 'derived reserved'} + + +class FeaturesHandler(BaseHandler): + + def __init__(self, context: Context, cluster: Cluster): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + self._bitmap = Bitmap(name="Feature", base_type="bitmap32", entries=[]) + + def EndProcessing(self): + if self._bitmap.entries: + self._cluster.bitmaps.append(self._bitmap) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name in {"section", "optionalConform"}: + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "feature": + if is_unused_name(attrs): + LOGGER.warning( + f"Ignoring feature constant data for {attrs['name']}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + + self._bitmap.entries.append( + AttributesToBitFieldConstantEntry(attrs)) + # assume everything handled. Sub-item is only section + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) + + +class BitmapHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + # TODO: base type is GUESSED here because xml does not contain it + self._bitmap = Bitmap(name=NormalizeName( + attrs["name"]), base_type="UNKNOWN", entries=[]) + + def EndProcessing(self): + if not self._bitmap.entries: + return + + # try to find the best size that fits + # TODO: this is a pure heuristic. XML containing this would be better. + # https://github.com/csa-data-model/projects/issues/345 + acceptable = {8, 16, 32, 64} + for entry in self._bitmap.entries: + if entry.code > 0xFF and 8 in acceptable: + acceptable.remove(8) + if entry.code > 0xFFFF and 16 in acceptable: + acceptable.remove(16) + if entry.code > 0xFFFFFFFF and 32 in acceptable: + acceptable.remove(32) + + if 8 in acceptable: + self._bitmap.base_type = "bitmap8" + elif 16 in acceptable: + self._bitmap.base_type = "bitmap16" + elif 32 in acceptable: + self._bitmap.base_type = "bitmap32" + else: + self._bitmap.base_type = "bitmap64" + + self._cluster.bitmaps.append(self._bitmap) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "bitfield": + self._bitmap.entries.append( + AttributesToBitFieldConstantEntry(attrs)) + # Assume fully handled. We do not parse "mandatoryConform and such" + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) + + +class MandatoryConformFieldHandler(BaseHandler): + def __init__(self, context: Context, field: Field): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._field = field + self._hadConditions = False + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + self._hadConditions = True + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + + def EndProcessing(self): + # A mandatory conformance with conditions means it is + # optional in some cases + if self._hadConditions: + self._field.qualities |= FieldQuality.OPTIONAL + + +class FieldHandler(BaseHandler): + def __init__(self, context: Context, field: Field): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._field = field + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "constraint": + ApplyConstraint(attrs, self._field) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "mandatoryConform": + return MandatoryConformFieldHandler(self.context, self._field) + elif name == "optionalConform": + self._field.qualities |= FieldQuality.OPTIONAL + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "access": + # per-field access is not something we model + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "quality": + if "nullable" in attrs and attrs["nullable"] != "false": + self._field.qualities = self._field.qualities | FieldQuality.NULLABLE + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "enum": + LOGGER.warning( + f"Anonymous enumeration not supported when handling field {self._field.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "bitmap": + LOGGER.warning( + f"Anonymous bitmap not supported when handling field {self._field.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "entry": + # Lists have "type=list" and then the type is inside entry + + if self._field.data_type.name != "list": + LOGGER.warning( + f"Entry type provided for non-list element {self._field.name}") + + assert "type" in attrs + + self._field.is_list = True + self._field.data_type.name = NormalizeDataType(attrs["type"]) + + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + +class StructHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + self._struct = Struct(name=NormalizeName(attrs["name"]), fields=[]) + + def EndProcessing(self): + self._cluster.structs.append(self._struct) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "field": + field = AttributesToField(attrs) + self._struct.fields.append(field) + return FieldHandler(self.context, field) + else: + return BaseHandler(self.context) + + +class EventHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + self._event = AttributesToEvent(attrs) + + def EndProcessing(self): + self._cluster.events.append(self._event) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "field": + field = AttributesToField(attrs) + self._event.fields.append(field) + return FieldHandler(self.context, field) + elif name == "mandatoryConform": + # assume handled (we do not record conformance in IDL) + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "access": + if "readPrivilege" in attrs: + self._event.readacl = StringToAccessPrivilege( + attrs["readPrivilege"]) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + +class EnumHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + # TODO: base type is GUESSED here because xml does not contain it + self._enum = Enum(name=NormalizeName( + attrs["name"]), base_type="UNKNOWN", entries=[]) + + def EndProcessing(self): + if not self._enum.entries: + return + + # try to find the best enum size that fits out of enum8, enum32 and enum32 + # TODO: this is a pure heuristic. XML containing this would be better. + # https://github.com/csa-data-model/projects/issues/345 + acceptable = {8, 16} + for entry in self._enum.entries: + if entry.code > 0xFF and 8 in acceptable: + acceptable.remove(8) + + if 8 in acceptable: + self._enum.base_type = "enum8" + else: + self._enum.base_type = "enum16" + + self._cluster.enums.append(self._enum) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "item": + for key in ["name", "value"]: + if key not in attrs: + logging.error("Enumeration %s entry is missing a '%s' entry (at %r)", + self._enum.name, key, self.context.GetCurrentLocationMeta()) + # bad entry, nothing I can do about it. + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + + self._enum.entries.append( + ConstantEntry( + name="k" + NormalizeName(attrs["name"]), code=ParseInt(attrs["value"])) + ) + # Assume fully handled + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) + + +class EventsHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "event": + return EventHandler(self.context, self._cluster, attrs) + else: + return BaseHandler(self.context) + + +class AttributeHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + self._attribute = AttributesToAttribute(attrs) + self._deprecated = False + + def EndProcessing(self): + if self._deprecated: + # Deprecation skips processing + return + + self._cluster.attributes.append(self._attribute) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "enum": + LOGGER.warning( + f"Anonymous enumeration not supported when handling attribute {self._cluster.name}::{self._attribute.definition.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "bitmap": + LOGGER.warning( + f"Anonymous bitmap not supported when handling attribute {self._cluster.name}::{self._attribute.definition.name}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "access": + if "readPrivilege" in attrs: + self._attribute.readacl = StringToAccessPrivilege( + attrs["readPrivilege"]) + + if "writePrivilege" in attrs: + self._attribute.writeacl = StringToAccessPrivilege( + attrs["writePrivilege"]) + + if "read" in attrs and attrs["read"] != "false": + self._attribute.qualities = self._attribute.qualities | AttributeQuality.READABLE + + if "write" in attrs and attrs["write"] != "false": + self._attribute.qualities = self._attribute.qualities | AttributeQuality.WRITABLE + + if "timed" in attrs and attrs["timed"] != "false": + self._attribute.qualities = self._attribute.qualities | AttributeQuality.TIMED_WRITE + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "quality": + # Out of the many interesting bits, only "nullable" seems relevant for codegen + if "nullable" in attrs and attrs["nullable"] != "false": + self._attribute.definition.qualities |= FieldQuality.NULLABLE + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "optionalConform": + self._attribute.definition.qualities |= FieldQuality.OPTIONAL + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "otherwiseConform": + self._attribute.definition.qualities |= FieldQuality.OPTIONAL + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "mandatoryConform": + return MandatoryConformFieldHandler(self.context, self._attribute.definition) + elif name == "provisionalConform": + self._attribute.api_maturity = ApiMaturity.PROVISIONAL + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "deprecateConform": + self._deprecated = True + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "constraint": + ApplyConstraint(attrs, self._attribute.definition) + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + else: + return BaseHandler(self.context) + + +class AttributesHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "attribute": + if is_unused_name(attrs): + LOGGER.warning(f"Ignoring attribute data for {attrs['name']}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + return AttributeHandler(self.context, self._cluster, attrs) + else: + return BaseHandler(self.context) + + +class CommandHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster, attrs: AttributesImpl): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + self._command: Optional[Command] = None + + # Command information layout: + # "response": + # - is mandatory for "requests" and contains + # 'Y' for default response and something else + # for non-default responses + # "direction": + # - sometimes missing (seems to just be request to client) + # - "commandToClient" + # - "responseFromServer" + # + + # Heuristic logic of direction: + # - if we have a response, this must be a request + # - if direction is "commandToClient" it should be a request + # - if direction is "responseFromServer" it should be a response + # otherwise guess + + if "response" in attrs: + is_command = True + elif ("direction" in attrs) and attrs["direction"] == "commandToClient": + is_command = True + elif ("direction" in attrs) and attrs["direction"] == "responseFromServer": + is_command = False # response + else: + LOGGER.warning("Could not clearly determine command direction: %s" % + [item for item in attrs.items()]) + # Do a best-guess. However we should NOT need to guess once + # we have a good data set + is_command = not attrs["name"].endswith("Response") + + if is_command: + self._command = AttributesToCommand(attrs) + self._struct = Struct(name=NormalizeName(attrs["name"] + "Request"), + fields=[], + tag=StructTag.REQUEST, + ) + else: + self._struct = Struct( + name=NormalizeName(attrs["name"]), + fields=[], + code=ParseInt(attrs["id"]), + tag=StructTag.RESPONSE, + ) + + def EndProcessing(self): + if self._struct and self._struct.fields: + # A valid structure exists ... + self._cluster.structs.append(self._struct) + + if self._command: + # Input structure is well defined, set it + self._command.input_param = self._struct.name + + if self._command: + self._cluster.commands.append(self._command) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name in {"mandatoryConform", "optionalConform", "disallowConform"}: + # Unclear how commands may be optional or mandatory + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "access": + # + if "invokePrivilege" in attrs: + if self._command: + self._command.invokeacl = StringToAccessPrivilege( + attrs["invokePrivilege"]) + else: + LOGGER.warning( + f"Ignoring invoke privilege for {self._struct.name}") + + if self._command: + if "timed" in attrs and attrs["timed"] != "false": + self._command.qualities |= CommandQuality.TIMED_INVOKE + + if "fabricScoped" in attrs and attrs["fabricScoped"] != "false": + self._command.qualities |= CommandQuality.FABRIC_SCOPED + + return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) + elif name == "field": + field = AttributesToField(attrs) + self._struct.fields.append(field) + return FieldHandler(self.context, field) + else: + return BaseHandler(self.context) + + +class CommandsHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "command": + if is_unused_name(attrs): + LOGGER.warning(f"Ignoring command data for {attrs['name']}") + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + + if 'id' not in attrs: + LOGGER.error( + f"Could not process command {attrs['name']}: no id") + # TODO: skip over these without failing the processing + # + # https://github.com/csa-data-model/projects/issues/364 + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + + return CommandHandler(self.context, self._cluster, attrs) + elif name in {"mandatoryConform", "optionalConform"}: + # Nothing to tag conformance + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + else: + return BaseHandler(self.context) + + +class DataTypesHandler(BaseHandler): + def __init__(self, context: Context, cluster: Cluster): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._cluster = cluster + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "number": + # Seems like a documentation of a number format + # + # TODO: actually ensure this has no meaning + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "enum": + return EnumHandler(self.context, self._cluster, attrs) + elif name == "bitmap": + return BitmapHandler(self.context, self._cluster, attrs) + elif name == "struct": + return StructHandler(self.context, self._cluster, attrs) + else: + return BaseHandler(self.context) + + +class ClusterHandlerPostProcessing(enum.Enum): + FINALIZE_AND_ADD_TO_IDL = enum.auto() + NO_POST_PROCESSING = enum.auto() + + +class ClusterHandler(BaseHandler): + """ Handling /cluster elements.""" + + @staticmethod + def ForAttributes(context: Context, idl: Idl, attrs: AttributesImpl): + assert ("name" in attrs) + assert ("id" in attrs) + + return ClusterHandler(context, idl, + Cluster( + side=ClusterSide.CLIENT, + name=NormalizeName(attrs["name"]), + code=ParseInt(attrs["id"]), + parse_meta=context.GetCurrentLocationMeta() + ), ClusterHandlerPostProcessing.FINALIZE_AND_ADD_TO_IDL) + + @staticmethod + def IntoCluster(context: Context, idl: Idl, cluster: Cluster): + return ClusterHandler(context, idl, cluster, ClusterHandlerPostProcessing.NO_POST_PROCESSING) + + def __init__(self, context: Context, idl: Idl, cluster: Cluster, post_process: ClusterHandlerPostProcessing): + super().__init__(context, handled=HandledDepth.SINGLE_TAG) + self._idl = idl + self._cluster = cluster + self._post_processing = post_process + + def EndProcessing(self): + if self._post_processing == ClusterHandlerPostProcessing.NO_POST_PROCESSING: + return + + assert self._post_processing == ClusterHandlerPostProcessing.FINALIZE_AND_ADD_TO_IDL + + # Global things MUST be available everywhere + to_add = [ + # type, code, name, is_list + ('attrib_id', 65531, 'attributeList', True), + ('event_id', 65530, 'eventList', True), + ('command_id', 65529, 'acceptedCommandList', True), + ('command_id', 65528, 'generatedCommandList', True), + ('bitmap32', 65532, 'featureMap', False), + ('int16u', 65533, 'clusterRevision', False), + ] + + for data_type, code, name, is_list in to_add: + self._cluster.attributes.append(Attribute(definition=Field( + data_type=DataType(name=data_type), + code=code, + name=name, + is_list=is_list, + ), qualities=AttributeQuality.READABLE)) + self._idl.clusters.append(self._cluster) + + def GetNextProcessor(self, name: str, attrs: AttributesImpl): + if name == "revisionHistory": + # Revision history COULD be used to find the latest revision of a cluster + # however current IDL files do NOT have a revision info field + # + # NOTE: we COULD set this as a `default` for attribute clusterRevision, however this will likely + # not match with what matter IDL would parse into. + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "section": + # Documentation data, skipped + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "classification": + if attrs['hierarchy'] == 'derived': + # This is a derived cluster. We have to add everything from the + # base cluster + self.context.AddIdlPostProcessor(AddBaseInfoPostProcessor( + destination_cluster=self._cluster, + source_cluster_name=attrs['baseCluster'], + context=self.context + )) + # other elements like picsCode, scope and primaryTransaction seem to have + # no direct mapping in the data model + return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + elif name == "features": + return FeaturesHandler(self.context, self._cluster) + elif name == "dataTypes": + return DataTypesHandler(self.context, self._cluster) + elif name == "events": + return EventsHandler(self.context, self._cluster) + elif name == "attributes": + return AttributesHandler(self.context, self._cluster) + elif name == "commands": + return CommandsHandler(self.context, self._cluster) + else: + return BaseHandler(self.context) diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/parsing.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/parsing.py new file mode 100644 index 00000000000000..3adb852b846334 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/parsing.py @@ -0,0 +1,346 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +import re +from dataclasses import dataclass +from typing import Optional +from xml.sax.xmlreader import AttributesImpl + +from matter_idl.generators.types import GetDataTypeSizeInBits, IsSignedDataType +from matter_idl.matter_idl_types import AccessPrivilege, Attribute, Command, ConstantEntry, DataType, Event, EventPriority, Field + +LOGGER = logging.getLogger('data-model-xml-data-parsing') + + +@dataclass +class ParsedType: + name: str + is_list: bool = False + + +def ParseInt(value: str, data_type: Optional[DataType] = None) -> int: + """ + Convert a string that is a known integer into an actual number. + + Supports decimal or hex values prefixed with '0x' + """ + if value.startswith('0x'): + parsed = int(value[2:], 16) + if data_type and IsSignedDataType(data_type): + bits = GetDataTypeSizeInBits(data_type) + assert (bits) # size MUST be known + if parsed & (1 << (bits - 1)): + parsed -= 1 << bits + return parsed + else: + return int(value) + + +def ParseOptionalInt(value: str) -> Optional[int]: + """Parses numbers as long as they are in an expected format of numbers. + + "1" parses to 1 + "0x12" parses to 18 + "Min" parses to None + """ + if re.match("^-?((0x[0-9a-fA-F]*)|([0-9]*))$", value): + return ParseInt(value) + + return None + + +_TYPE_REMAP = { + # unsigned + "uint8": "int8u", + "uint16": "int16u", + "uint24": "int24u", + "uint32": "int32u", + "uint48": "int48u", + "uint52": "int52u", + "uint64": "int64u", + # signed (map to what zapxml/matter currently has) + "int8": "int8s", + "int16": "int16s", + "int24": "int24s", + "int32": "int32s", + "int48": "int48s", + "int52": "int52s", + "int64": "int64s", + # other + "bool": "boolean", + "string": "char_string", + "octets": "octet_string", +} + + +def NormalizeDataType(t: str) -> str: + """Convert data model xml types into matter idl types.""" + return _TYPE_REMAP.get(t.lower(), t.replace("-", "_")) + + +# Handle oddities in current data model XML schema for nicer diffs +_REF_NAME_MAPPING = { + "<>": "char_string", + "<>": "octet_string", + "<>": "vendor_id", + "<>": "endpoint_no", +} + + +def ParseType(t: str) -> ParsedType: + """Parse a data type entry. + + Specifically parses a name like "list[Foo Type]". + """ + + # very rough matcher ... + is_list = False + if t.startswith("list[") and t.endswith("]"): + is_list = True + t = t[5:-1] + elif t.startswith("<>[") and t.endswith("]"): + is_list = True + t = t[21:-1] + + if t.endswith(" Type"): + t = t[:-5] + + if t in _REF_NAME_MAPPING: + t = _REF_NAME_MAPPING[t] + + return ParsedType(name=NormalizeDataType(t), is_list=is_list) + + +def NormalizeName(name: str) -> str: + """Convert a free form name from the spec into a programming language + name that is appropriate for matter IDL. + """ + + # Trim human name separators + for separator in " /-": + name = name.replace(separator, '_') + while '__' in name: + name = name.replace('__', '_') + + # NOTE: zapt generators for IDL files use a construct of the form + # `{{asUpperCamelCase name preserveAcronyms=true}}` + # and it is somewhat unclear what preserveAcronyms will do. + # + # Current assumption is that spec already has acronyms set in + # the correct place and at least for some basic tests this method + # generates good names + # + # If any acronyms seem off in naming at some point, more logic may + # be needed here. + + # At this point, we remove all _ and make sure _ is followed by an uppercase + while name.endswith('_'): + name = name[:-1] + + while '_' in name: + idx = name.find('_') + name = name[:idx] + name[idx+1].upper() + name[idx+2:] + + return name + + +def FieldName(input_name: str) -> str: + """Normalized name with the first letter lowercase. """ + name = NormalizeName(input_name) + + # Some exception handling for nicer diffs + if name == "ID": + return "id" + + # If the name starts with a all-uppercase thing, keep it that + # way. This is typical for "NOC", "IPK", "CSR" and such + if len(input_name) > 1: + if input_name[0].isupper() and input_name[1].isupper(): + return name + + return name[0].lower() + name[1:] + + +def AttributesToField(attrs: AttributesImpl) -> Field: + assert "name" in attrs + assert "id" in attrs + + if "type" in attrs: + attr_type = NormalizeDataType(attrs["type"]) + else: + # TODO: Generally we should not have this, however current implementation + # for derived clusters for example want to add things (like conformance + # specifically) WITHOUT re-stating things like types + # + # https://github.com/csa-data-model/projects/issues/365 + LOGGER.error(f"Attribute {attrs['name']} has no type") + attr_type = "sint32" + t = ParseType(attr_type) + + return Field( + name=FieldName(attrs["name"]), + code=ParseInt(attrs["id"]), + is_list=t.is_list, + data_type=DataType(name=t.name), + ) + + +def AttributesToBitFieldConstantEntry(attrs: AttributesImpl) -> ConstantEntry: + """Creates a constant entry appropriate for bitmaps. + """ + assert "name" in attrs + + if 'bit' not in attrs: + # TODO: multi-bit fields not supported in XML currently. Be lenient here to have some + # diff + # Issue: https://github.com/csa-data-model/projects/issues/347 + + LOGGER.error( + f"Constant {attrs['name']} has no bit value (may be multibit)") + return ConstantEntry(name="k" + NormalizeName(attrs["name"]), code=0) + + assert "bit" in attrs + + return ConstantEntry(name="k" + NormalizeName(attrs["name"]), code=1 << ParseInt(attrs["bit"])) + + +def AttributesToAttribute(attrs: AttributesImpl) -> Attribute: + assert "name" in attrs + assert "id" in attrs + + if "type" in attrs: + attr_type = NormalizeDataType(attrs["type"]) + else: + # TODO: we should NOT have this, however we are now lenient + # to bad input data + LOGGER.error(f"Attribute {attrs['name']} has no type") + attr_type = "sint32" + + t = ParseType(attr_type) + + return Attribute( + definition=Field( + code=ParseInt(attrs["id"]), + name=FieldName(attrs["name"]), + is_list=t.is_list, + data_type=DataType(name=t.name), + ) + ) + + +def AttributesToEvent(attrs: AttributesImpl) -> Event: + assert "name" in attrs + assert "id" in attrs + assert "priority" in attrs + + if attrs["priority"] == "critical": + priority = EventPriority.CRITICAL + elif attrs["priority"] == "info": + priority = EventPriority.INFO + elif attrs["priority"] == "debug": + priority = EventPriority.DEBUG + elif attrs["priority"] == "desc": + LOGGER.warn("Found an event with 'desc' priority: %s" % + [item for item in attrs.items()]) + priority = EventPriority.CRITICAL + else: + raise Exception("UNKNOWN event priority: %r" % attrs["priority"]) + + return Event( + name=NormalizeName(attrs["name"]), + code=ParseInt(attrs["id"]), + priority=priority, + fields=[]) + + +def StringToAccessPrivilege(value: str) -> AccessPrivilege: + if value == "view": + return AccessPrivilege.VIEW + elif value == "operate": + return AccessPrivilege.OPERATE + elif value == "manage": + return AccessPrivilege.MANAGE + elif value == "admin": + return AccessPrivilege.ADMINISTER + else: + raise Exception("UNKNOWN privilege level: %r" % value) + + +def AttributesToCommand(attrs: AttributesImpl) -> Command: + assert "id" in attrs + assert "name" in attrs + + if "response" not in attrs: + LOGGER.warn(f"Command {attrs['name']} has no response set.") + # Matter IDL has no concept of "no response sent" + # Example is DoorLock::"Operating Event Notification" + # + # However that is not in the impl in general + # it is unclear what to do here (and what "NOT" is as conformance) + + output_param = "DefaultSuccess" + else: + output_param = NormalizeName(attrs["response"]) + if output_param == "Y": + output_param = "DefaultSuccess" # IDL name for no specific struct + + return Command( + name=NormalizeName(attrs["name"]), + code=ParseInt(attrs["id"]), + input_param=None, # not specified YET + output_param=output_param + ) + + +def ApplyConstraint(attrs, field: Field): + """ + Handles constraints according to Matter IDL formats. + + Specifically it does NOT handle min/max values as current IDL + format does not support having such values defined. + """ + assert "type" in attrs + + constraint_type = attrs["type"] + + if constraint_type == "allowed": + pass # unsure what to do allowed + elif constraint_type == "desc": + pass # free-form description + elif constraint_type in {"countBetween", "maxCount"}: + pass # cannot implement count + elif constraint_type == "min": + # field.data_type.min_value = ParseOptionalInt(attrs["value"]) + pass + elif constraint_type == "max": + # field.data_type.max_value = ParseOptionalInt(attrs["value"]) + pass + elif constraint_type == "between": + # TODO: examples existing in the parsed data which are NOT + # handled: + # - from="-2.5°C" to="2.5°C" + # - from="0%" to="100%" + # field.data_type.min_value = ParseOptionalInt(attrs["from"]) + # field.data_type.max_value = ParseOptionalInt(attrs["to"]) + pass + elif constraint_type == "maxLength": + field.data_type.max_length = ParseOptionalInt(attrs["value"]) + elif constraint_type == "minLength": + field.data_type.min_length = ParseOptionalInt(attrs["value"]) + elif constraint_type == "lengthBetween": + field.data_type.min_length = ParseOptionalInt(attrs["from"]) + field.data_type.max_length = ParseOptionalInt(attrs["to"]) + else: + logging.error(f"UNKNOWN constraint type {constraint_type}") diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml_parser.py b/scripts/py_matter_idl/matter_idl/data_model_xml_parser.py new file mode 100755 index 00000000000000..e0878572d0536f --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/data_model_xml_parser.py @@ -0,0 +1,181 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +import os +import sys +from typing import Optional + +import click + +try: + from matter_idl.data_model_xml import ParseSource, ParseXmls +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_idl.data_model_xml import ParseSource, ParseXmls + +from matter_idl.generators import GeneratorStorage +from matter_idl.generators.idl import IdlGenerator +from matter_idl.matter_idl_parser import CreateParser +from matter_idl.matter_idl_types import Idl + + +class InMemoryStorage(GeneratorStorage): + def __init__(self): + super().__init__() + self.content: Optional[str] = None + + def get_existing_data(self, relative_path: str): + # Force re-generation each time + return None + + def write_new_data(self, relative_path: str, content: str): + if self.content: + raise Exception( + "Unexpected extra data: single file generation expected") + self.content = content + + +def normalize_order(idl: Idl): + """Re-sorts contents of things inside a cluster so that + output is easily diffed by humans + """ + + # This method exists because `zapt` generation of IDL files + # are generally based on SQL select query ordering, likely + # with some sort fields to achieve determinism + # + # However overall, especially if manual editing, it seems + # easier to just fix a sort order instead of trying to + # match another tool ordering that resides in another + # code location. + + idl.clusters.sort(key=lambda c: c.name) + + for cluster in idl.clusters: + cluster.enums.sort(key=lambda e: e.name) + cluster.bitmaps.sort(key=lambda b: b.name) + cluster.events.sort(key=lambda e: e.code) + cluster.attributes.sort(key=lambda a: a.definition.code) + cluster.structs.sort(key=lambda s: s.name) + cluster.commands.sort(key=lambda c: c.code) + + +# Supported log levels, mapping string values required for argument +# parsing into logging constants +__LOG_LEVELS__ = { + 'debug': logging.DEBUG, + 'info': logging.INFO, + 'warn': logging.WARN, + 'fatal': logging.FATAL, +} + + +@click.command() +@click.option( + '--log-level', + default='INFO', + show_default=True, + type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), + help='Determines the verbosity of script output.') +@click.option( + '--no-print', + show_default=True, + default=False, + is_flag=True, + help='Do not pring output data (parsed data)') +@click.option( + "-o", + "--output", + default=None, + type=click.Path(), + help="Where to output the parsed IDL." +) +@click.option( + "--compare", + default=None, + type=click.Path(exists=True), + help="An input .matter IDL to compare with." +) +@click.option( + "--compare-output", + default=None, + type=click.Path(), + help="Where to output the compare IDL" +) +@click.argument('filenames', nargs=-1) +def main(log_level, no_print, output, compare, compare_output, filenames): + """ + A program supporting parsing of CSA data model XML files and generating them + as human readable IDL output. + + Also supports parsing and generating a diff against an existing .matter file, + such as using: + + \b + ./scripts/py_matter_idl/matter_idl/data_model_xml_parser.py \\ + --compare src/controller/data_model/controller-clusters.matter \\ + --compare-output out/orig.matter \\ + --output out/from_xml.matter \\ + data_model/clusters/Switch.xml + """ + logging.basicConfig( + level=__LOG_LEVELS__[log_level], + format='%(asctime)s %(levelname)-7s %(message)s', + ) + + if (compare is None) != (compare_output is None): + logging.error( + "Either both or none of --compare AND --compare-output must be set") + sys.exit(1) + + logging.info("Starting to parse ...") + + sources = [ParseSource(source=name) for name in filenames] + data = ParseXmls(sources) + logging.info("Parse completed") + + if compare: + other_idl = CreateParser(skip_meta=True).parse( + open(compare).read(), file_name=compare) + + # ensure that input file is filtered to only interesting + # clusters + loaded_clusters = set([c.code for c in data.clusters]) + other_idl.clusters = [ + c for c in other_idl.clusters if c.code in loaded_clusters] + + # Ensure consistent ordering for compares + normalize_order(data) + normalize_order(other_idl) + + storage = InMemoryStorage() + IdlGenerator(storage=storage, idl=other_idl).render(dry_run=False) + with open(compare_output, 'wt', encoding="utf8") as o: + o.write(storage.content) + + storage = InMemoryStorage() + IdlGenerator(storage=storage, idl=data).render(dry_run=False) + + if output: + with open(output, 'wt', encoding="utf8") as o: + o.write(storage.content) + elif not no_print: + print(storage.content) + + +if __name__ == '__main__': + main(auto_envvar_prefix='CHIP') diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja new file mode 100644 index 00000000000000..91e978a44c7b07 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/idl/MatterIdl.jinja @@ -0,0 +1,150 @@ +{% macro render_field(field) -%}{# + Macro for the output of a single field entry such as: + + int16u identifyTime = 0; + optional int16u transitionTime = 3; + optional nullable int16u transitionTime = 2; + optional ExtensionFieldSet extensionFieldSets[] = 5; +#} + +{%- if field.qualities %}{{field.qualities | idltxt}} {% endif -%} +{{field.data_type.name}} +{%- if field.data_type.max_length -%} <{{field.data_type.max_length}}> {%- endif -%} +{##} {{field.name}} +{%- if field.is_list %}[]{% endif -%} +{##} = {{field.code}}; +{%- endmacro -%} + +{% macro render_struct(s) -%}{# + Macro for the output of a complete struct +#} + {%- if s.tag %}{{s.tag | idltxt}} {% endif -%} + {% if s.qualities %}{{s.qualities | idltxt}} {% endif -%} + struct {{s.name}} {##} + {%- if s.code is not none %}= {{s.code}} {% endif -%} + { + {% for field in s.fields %} + {{render_field(field)}} + {% endfor %} + } +{%- endmacro -%} + + +// This IDL was auto-generated from a parsed data structure + +{% for cluster in idl.clusters %} +{% if cluster.description %}/** {{cluster.description}} */ +{% endif %} +{{cluster.api_maturity | idltxt}}{{cluster.side | idltxt}} cluster {{cluster.name}} = {{cluster.code}} { + {%- for enum in cluster.enums %} + + enum {{enum.name}} : {{ enum.base_type}} { + {% for entry in enum.entries %} + {{entry.name}} = {{entry.code}}; + {% endfor %} + } + {% endfor %} + + {%- for bitmap in cluster.bitmaps %} + + bitmap {{bitmap.name}} : {{ bitmap.base_type}} { + {% for entry in bitmap.entries %} + {{entry.name}} = 0x{{"%X" | format(entry.code)}}; + {% endfor %} + } + {% endfor %} + + {%- for s in cluster.structs | rejectattr("tag") %} + {% if loop.first %} + + {% endif %} + {{render_struct(s)}} + {% if not loop.last %} + + {% endif %} + {% endfor %} + + {%- for e in cluster.events %} + {% if loop.first %} + + {% endif %} + {##} {##}{% if e.qualities %}{{e.qualities | idltxt}} {% endif -%} + {{e.priority | idltxt}} event {{e | event_access}}{{e.name}} = {{e.code}} { + {% for field in e.fields %} + {{render_field(field)}} + {% endfor %} + } + {% if not loop.last %} + + {% endif %} + {% endfor %} + + {%- for a in cluster.attributes %} + {% if loop.first %} + + {% endif %} + {{a.qualities | idltxt}}attribute {{a | attribute_access}}{{render_field(a.definition)}} + {% endfor %} + + {%- for s in cluster.structs | selectattr("tag") %} + + {{render_struct(s)}} + {% endfor %} + + {%- for c in cluster.commands %} + {% if loop.first %} + + {% endif %} + {% if c.description %} + /** {{c.description}} */ + {% endif %} + {{c.qualities | idltxt}}command {{c | command_access}}{{c.name}}( + {%- if c.input_param %}{{c.input_param}}{% endif -%} + ): {{c.output_param}} = {{c.code}}; + {% endfor %} +} + +{% endfor %} + +{%- if idl.endpoints %} +{%- for endpoint in idl.endpoints %} +endpoint {{endpoint.number}} { + {% for t in endpoint.device_types %} + device type {{t.name}} = {{t.code}}, version {{t.version}}; + {% endfor%} + + {%-for b in endpoint.client_bindings %} + {% if loop.first %} + + {% endif %} + binding cluster {{b}}; + {% endfor %} + + {%-for c in endpoint.server_clusters %} + + server cluster {{c.name}} { + {% for e in c.events_emitted %} + emits event {{e}}; + {% if loop.last %} + + {% endif %} + {% endfor %} + {% for a in c.attributes %} + {{"%-8s" | format(a.storage|idltxt) }} attribute {{a.name}} + {%- if a.default is not none %} default = {{a.default|render_default}} {%- endif %}; + {% endfor %} + {% for cmd in c.commands %} + {% if loop.first %} + + {% endif %} + handle command {{cmd.name}}; + {% endfor %} + } + {% endfor %} + +} +{% if not loop.last %} + +{% endif %} +{% endfor %} +{% endif %} diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/README.md b/scripts/py_matter_idl/matter_idl/generators/idl/README.md new file mode 100644 index 00000000000000..c19b428482e017 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/idl/README.md @@ -0,0 +1,32 @@ +## Generator description + +Generates a structured `Idl` data type into a human-readable text format +(`.matter` file). + +It is useful for tools that ingest non-idl data but convert into idl data (e.g. +`zapxml` or CSA data model XML data.) + +### Usage + +A no-op usage can be: + +``` +./scripts/codegen.py -g idl --output-dir out/idlgen examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +``` + +which would re-generate the entire `all-clusters-app.matter` into +`out/idlgen/idl.matter` + +This generation is useful for testing/validating that both parsing and +generation works. Actual usage of this generator would be inside XML tools. + +### Within XML parsing + +A XML parser will use this code generator to output a human readable view of the +parsed data: + +``` +./scripts/py_matter_idl/matter_idl/zapxml_parser.py \ + ./src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ + ./src/app/zap-templates/zcl/data-model/chip/global-attributes.xm +``` diff --git a/scripts/py_matter_idl/matter_idl/generators/idl/__init__.py b/scripts/py_matter_idl/matter_idl/generators/idl/__init__.py new file mode 100644 index 00000000000000..9ac9085f0cc68b --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/idl/__init__.py @@ -0,0 +1,204 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Union + +from matter_idl.generators import CodeGenerator, GeneratorStorage +from matter_idl.matter_idl_types import (AccessPrivilege, ApiMaturity, Attribute, AttributeQuality, AttributeStorage, ClusterSide, + Command, CommandQuality, Event, EventPriority, EventQuality, FieldQuality, Idl, + StructQuality, StructTag) + + +def human_text_string(value: Union[ClusterSide, StructTag, StructQuality, EventPriority, EventQuality, AccessPrivilege, AttributeQuality, CommandQuality, ApiMaturity, AttributeStorage]) -> str: + if type(value) is ClusterSide: + if value == ClusterSide.CLIENT: + return "client" + if value == ClusterSide.SERVER: + return "server" + elif type(value) is StructTag: + if value == StructTag.REQUEST: + return "request" + if value == StructTag.RESPONSE: + return "response" + elif type(value) is FieldQuality: + # mypy seems confused if using `FieldQuality.OPTIONAL in value` + # directly, so do a useless cast here + quality: FieldQuality = value + + result = "" + if FieldQuality.OPTIONAL in quality: + result += "optional " + if FieldQuality.NULLABLE in quality: + result += "nullable " + if FieldQuality.FABRIC_SENSITIVE in quality: + result += "fabric_sensitive " + return result.strip() + elif type(value) is StructQuality: + result = "" + if value == StructQuality.FABRIC_SCOPED: + result += "fabric_scoped " + return result.strip() + elif type(value) is EventPriority: + if value == EventPriority.DEBUG: + return "debug" + if value == EventPriority.INFO: + return "info" + if value == EventPriority.CRITICAL: + return "critical" + elif type(value) is EventQuality: + result = "" + if EventQuality.FABRIC_SENSITIVE in value: + result += "fabric_sensitive " + return result.strip() + elif type(value) is AccessPrivilege: + if value == AccessPrivilege.VIEW: + return "view" + if value == AccessPrivilege.OPERATE: + return "operate" + if value == AccessPrivilege.MANAGE: + return "manage" + if value == AccessPrivilege.ADMINISTER: + return "administer" + elif type(value) is AttributeQuality: + result = "" + if AttributeQuality.TIMED_WRITE in value: + result += "timedwrite " + if AttributeQuality.WRITABLE not in value: + result += "readonly " + if AttributeQuality.NOSUBSCRIBE in value: + result += "nosubscribe " + return result + elif type(value) is CommandQuality: + result = "" + if CommandQuality.TIMED_INVOKE in value: + result += "timed " + if CommandQuality.FABRIC_SCOPED in value: + result += "fabric " + return result + elif type(value) is ApiMaturity: + if value == ApiMaturity.STABLE: + return "" + if value == ApiMaturity.PROVISIONAL: + return "provisional " + if value == ApiMaturity.INTERNAL: + return "internal " + if value == ApiMaturity.DEPRECATED: + return "deprecated " + elif type(value) is AttributeStorage: + if value == AttributeStorage.RAM: + return "ram" + if value == AttributeStorage.PERSIST: + return "persist" + if value == AttributeStorage.CALLBACK: + return "callback" + + # wrong value in general + return "Unknown/unsupported: %r" % value + + +def event_access_string(e: Event) -> str: + """Generates the access string required for an event. If string is non-empty it will + include a trailing space + """ + result = "" + if e.readacl != AccessPrivilege.VIEW: + result += "read: " + human_text_string(e.readacl) + + if not result: + return "" + return f"access({result}) " + + +def command_access_string(c: Command) -> str: + """Generates the access string required for a command. If string is non-empty it will + include a trailing space + """ + result = "" + if c.invokeacl != AccessPrivilege.OPERATE: + result += "invoke: " + human_text_string(c.invokeacl) + + if not result: + return "" + return f"access({result}) " + + +def attribute_access_string(a: Attribute) -> str: + """Generates the access string required for a struct. If string is non-empty it will + include a trailing space + """ + result = [] + + if a.readacl != AccessPrivilege.VIEW: + result.append("read: " + human_text_string(a.readacl)) + + if a.writeacl != AccessPrivilege.OPERATE: + result.append("write: " + human_text_string(a.writeacl)) + + if not result: + return "" + + return f"access({', '.join(result)}) " + + +def render_default(value: Union[str, int, bool]) -> str: + """ + Renders a idl-style default. + + Generally quotes strings and handles bools + """ + if type(value) is str: + # TODO: technically this should support escaping for quotes + # however currently we never needed this. Escaping can be + # added once we use this info + return f'"{value}"' + elif type(value) is bool: + if value: + return "true" + else: + return "false" + return str(value) + + +class IdlGenerator(CodeGenerator): + """ + Generation .matter idl files for a given IDL + """ + + def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): + super().__init__(storage, idl, fs_loader_searchpath=os.path.dirname(__file__)) + + self.jinja_env.filters['idltxt'] = human_text_string + self.jinja_env.filters['event_access'] = event_access_string + self.jinja_env.filters['command_access'] = command_access_string + self.jinja_env.filters['attribute_access'] = attribute_access_string + self.jinja_env.filters['render_default'] = render_default + + # Easier whitespace management + self.jinja_env.trim_blocks = True + self.jinja_env.lstrip_blocks = True + + def internal_render_all(self): + """ + Renders the output. + """ + + # Header containing a macro to initialize all cluster plugins + self.internal_render_one_output( + template_path="MatterIdl.jinja", + output_file_name="idl.matter", + vars={ + 'idl': self.idl + } + ) diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja new file mode 100644 index 00000000000000..1137f582a1a3f9 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClusters_java.jinja @@ -0,0 +1,304 @@ +{%- macro encode_value(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_optional -%} + Optional<{{encode_value(source, encodable.without_optional(), depth + 1)}}> + {%- elif encodable.is_list -%} + ArrayList<{{encode_value(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value_without_optional(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_list -%} + List<{{encode_value_without_optional(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional_nullable(source, encodable, depth) -%} + {%- if encodable.is_list -%} + ArrayList<{{encode_value_without_optional_nullable(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +public class ChipClusters { + + public interface DefaultClusterCallback { + void onSuccess(); + void onError(Exception error); + } + + public interface CharStringAttributeCallback { + /** Indicates a successful read for a CHAR_STRING attribute. */ + void onSuccess(String value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface OctetStringAttributeCallback { + /** Indicates a successful read for an OCTET_STRING attribute. */ + void onSuccess(byte[] value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface IntegerAttributeCallback { + void onSuccess(int value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface LongAttributeCallback { + void onSuccess(long value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface BooleanAttributeCallback { + void onSuccess(boolean value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface FloatAttributeCallback { + void onSuccess(float value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DoubleAttributeCallback { + void onSuccess(double value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public static abstract class BaseChipCluster { + protected long chipClusterPtr; + + public BaseChipCluster(long devicePtr, int endpointId) { + chipClusterPtr = initWithDevice(devicePtr, endpointId); + } + + /** + * Sets the timeout, in milliseconds, after which commands sent through this cluster will fail + * with a timeout (regardless of whether or not a response has been received). If set to an + * empty optional, the default timeout will be used. + */ + public void setCommandTimeout(Optional timeoutMillis) { + setCommandTimeout(chipClusterPtr, timeoutMillis); + } + + private native void setCommandTimeout(long clusterPtr, Optional timeoutMillis); + + /** Returns the current timeout (in milliseconds) for commands sent through this cluster. */ + public Optional getCommandTimeout() { + Optional timeout = getCommandTimeout(chipClusterPtr); + return timeout == null ? Optional.empty() : timeout; + } + + private native Optional getCommandTimeout(long clusterPtr); + + public abstract long initWithDevice(long devicePtr, int endpointId); + + public native void deleteCluster(long chipClusterPtr); + + @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + + if (chipClusterPtr != 0) { + deleteCluster(chipClusterPtr); + chipClusterPtr = 0; + } + } + } +{% for cluster in clientClusters | sort(attribute='code') %} +{%- set typeLookup = idl | createLookupContext(cluster) %} + public static class {{cluster.name}}Cluster extends BaseChipCluster { + public static final long CLUSTER_ID = {{cluster.code}}L; + + public {{cluster.name}}Cluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); +{% for command in cluster.commands | sort(attribute='code') -%} +{%- set callbackName = command | javaCommandCallbackName() -%} +{%- if not command.is_timed_invoke %} + public void {{command.name | lowfirst_except_acronym}}({{callbackName}}Callback callback +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} + , {{encode_value(cluster, encodable, 0)}} {{field.name | lowfirst_except_acronym}} +{%- endfor -%} +{%- endif -%} + ) { + {{command.name | lowfirst_except_acronym}}(chipClusterPtr, callback +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} + , {{field.name | lowfirst_except_acronym}} +{%- endfor -%} +{%- endif -%} + , null); + } +{%- endif %} + + public void {{command.name | lowfirst_except_acronym}}({{callbackName}}Callback callback +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} + , {{encode_value(cluster, encodable, 0)}} {{field.name | lowfirst_except_acronym}} +{%- endfor -%} +{%- endif -%} + , int timedInvokeTimeoutMs) { + {{command.name | lowfirst_except_acronym}}(chipClusterPtr, callback +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} + , {{field.name | lowfirst_except_acronym}} +{%- endfor -%} +{%- endif -%} + , timedInvokeTimeoutMs); + } +{% endfor %} +{%- for command in cluster.commands | sort(attribute='code') -%} +{%- set callbackName = command | javaCommandCallbackName() %} + private native void {{command.name | lowfirst_except_acronym}}(long chipClusterPtr, {{callbackName}}Callback callback +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} + , {{encode_value(cluster, encodable, 0)}} {{field.name | lowfirst_except_acronym}} +{%- endfor -%} +{%- endif -%} + , @Nullable Integer timedInvokeTimeoutMs); +{% endfor %} +{%- set already_handled_command = [] -%} +{%- for command in cluster.commands | sort(attribute='code') -%} +{%- if command | isCommandNotDefaultCallback() -%} +{%- set callbackName = command | javaCommandCallbackName() -%} +{%- if callbackName not in already_handled_command %} + public interface {{callbackName}}Callback { + void onSuccess( +{%- for field in (cluster.structs | named(command.output_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} + {{encode_value(cluster, encodable, 0)}} {{field.name | lowfirst_except_acronym}} + {%- if loop.index0 < loop.length - 1 -%}{{", "}}{%- endif -%} +{%- endfor -%} + ); + void onError(Exception error); + } +{% if already_handled_command.append(callbackName) -%} +{#- This block does nothing, it only exists to append to already_handled_command. -#} +{%- endif -%} +{%- endif -%} +{%- endif -%} +{%- endfor %} +{%- set already_handled_attribute = [] -%} +{% for attribute in cluster.attributes | rejectattr('definition', 'is_field_global_name', typeLookup) %} +{%- set encodable = attribute.definition | asEncodable(typeLookup) -%} +{%- set interfaceName = attribute | javaAttributeCallbackName(typeLookup) -%} +{%- if interfaceName not in already_handled_attribute %} + public interface {{interfaceName}} { + void onSuccess({{encode_value_without_optional(cluster, encodable, 0)}} value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } +{% if already_handled_attribute.append(interfaceName) -%} +{#- This block does nothing, it only exists to append to already_handled_attribute. -#} +{%- endif -%} +{%- endif -%} +{% endfor -%} +{% for attribute in cluster.attributes | sort(attribute='code') %} + public void read{{attribute.definition.name | upfirst}}Attribute( + {{attribute | javaAttributeCallbackName(typeLookup) }} callback) { + read{{attribute.definition.name | upfirst}}Attribute(chipClusterPtr, callback +{%- if attribute | isFabricScopedList(typeLookup) -%} +, true +{%- endif -%} + ); + } +{% if attribute | isFabricScopedList(typeLookup) %} + public void read{{attribute.definition.name | upfirst}}AttributeWithFabricFilter( + {{attribute | javaAttributeCallbackName(typeLookup) }} callback, boolean isFabricFiltered) { + read{{attribute.definition.name | upfirst}}Attribute(chipClusterPtr, callback, isFabricFiltered); + } + +{% endif -%} +{%- if attribute.is_writable %} +{%- set encodable = attribute.definition | asEncodable(typeLookup) -%} +{%- set encodable2 = attribute.definition | asEncodable(typeLookup) -%} +{%- if not attribute.requires_timed_write %} + public void write{{attribute.definition.name | upfirst}}Attribute(DefaultClusterCallback callback, {{encode_value_without_optional_nullable(cluster, encodable, 0)}} value) { + write{{attribute.definition.name | upfirst}}Attribute(chipClusterPtr, callback, value, null); + } +{% endif %} + public void write{{attribute.definition.name | upfirst}}Attribute(DefaultClusterCallback callback, {{encode_value_without_optional_nullable(cluster, encodable2, 0)}} value, int timedWriteTimeoutMs) { + write{{attribute.definition.name | upfirst}}Attribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } +{% endif %} +{%- if attribute.is_subscribable %} + public void subscribe{{attribute.definition.name | upfirst}}Attribute( + {{attribute | javaAttributeCallbackName(typeLookup) }} callback, int minInterval, int maxInterval) { + subscribe{{attribute.definition.name | upfirst}}Attribute(chipClusterPtr, callback, minInterval, maxInterval); + } +{% endif -%} +{%- endfor %} +{%- for attribute in cluster.attributes %} + private native void read{{attribute.definition.name | upfirst}}Attribute(long chipClusterPtr, {{attribute | javaAttributeCallbackName(typeLookup) }} callback +{%- if attribute | isFabricScopedList(typeLookup) -%} + , boolean isFabricFiltered +{%- endif -%} + ); +{% if attribute.is_writable -%} +{%- set encodable = attribute.definition | asEncodable(typeLookup) %} + private native void write{{attribute.definition.name | upfirst}}Attribute(long chipClusterPtr, DefaultClusterCallback callback, {{encode_value_without_optional_nullable(cluster, encodable, 0)}} value, @Nullable Integer timedWriteTimeoutMs); +{% endif -%} +{% if attribute.is_subscribable %} + private native void subscribe{{attribute.definition.name | upfirst}}Attribute(long chipClusterPtr, {{attribute | javaAttributeCallbackName(typeLookup) }} callback, int minInterval, int maxInterval); +{% endif -%} +{% endfor -%} +{% raw %} } +{% endraw %} +{%- endfor -%} +} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipEventStructs_java.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipEventStructs_java.jinja new file mode 100644 index 00000000000000..aa1a2fed451cd3 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipEventStructs_java.jinja @@ -0,0 +1,88 @@ +{%- macro encode_value(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_optional -%} + Optional<{{encode_value(source, encodable.without_optional(), depth + 1)}}> + {%- elif encodable.is_list -%} + ArrayList<{{encode_value(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Optional; + +public class ChipEventStructs { +{%- for cluster in clientClusters | sort(attribute='code') -%} +{%- set typeLookup = idl | createLookupContext(cluster) %} +{%- for event in cluster.events %} +{%- if event.fields %} +public static class {{cluster.name}}Cluster{{event.name}}Event { + {%- for field in event.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + public {{encode_value(cluster, encodable, 0)}} {{field.name}}; + {%- endfor %} + public {{cluster.name}}Cluster{{event.name}}Event( + {%- for field in event.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + {{encode_value(cluster, encodable, 0)}} {{field.name}} + {%- if loop.index0 < loop.length - 1 -%}{{","}}{%- endif -%} + {%- endfor %} + ) { + {%- for field in event.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + this.{{field.name}} = {{field.name}}; + {%- endfor %} + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("{{cluster.name}}Cluster{{event.name}}Event {\n"); + {%- for field in event.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + output.append("\t{{field.name}}: "); + {%- if encodable.is_list %} + output.append({{field.name}}); + {%- elif encodable.is_octet_string %} + {%- if encodable.is_optional %} + output.append({{field.name}}.isPresent() ? Arrays.toString({{field.name}}.get()) : ""); + {%- else %} + output.append(Arrays.toString({{field.name}})); + {%- endif %} + {%- else %} + output.append({{field.name}}); + {%- endif %} + output.append("\n"); + {%- endfor %} + output.append("}\n"); + return output.toString(); + } +} +{%- endif %} +{%- endfor %} +{%- endfor %} +} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipStructs_java.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipStructs_java.jinja new file mode 100644 index 00000000000000..8001e95bfeb656 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipStructs_java.jinja @@ -0,0 +1,88 @@ +{%- macro encode_value(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_optional -%} + Optional<{{encode_value(source, encodable.without_optional(), depth + 1)}}> + {%- elif encodable.is_list -%} + ArrayList<{{encode_value(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Optional; + +public class ChipStructs { +{%- for cluster in clientClusters | sort(attribute='code') -%} +{%- set typeLookup = idl | createLookupContext(cluster) %} +{%- for struct in cluster.structs %} +{%- if not struct.tag %} +public static class {{cluster.name}}Cluster{{struct.name}} { + {%- for field in struct.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + public {{encode_value(cluster, encodable, 0)}} {{field.name}}; + {%- endfor %} + public {{cluster.name}}Cluster{{struct.name}}( + {%- for field in struct.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + {{encode_value(cluster, encodable, 0)}} {{field.name}} + {%- if loop.index0 < loop.length - 1 -%}{{","}}{%- endif -%} + {%- endfor %} + ) { + {%- for field in struct.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + this.{{field.name}} = {{field.name}}; + {%- endfor %} + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("{{cluster.name}}Cluster{{struct.name}} {\n"); + {%- for field in struct.fields %} + {%- set encodable = field | asEncodable(typeLookup) %} + output.append("\t{{field.name}}: "); + {%- if encodable.is_list %} + output.append({{field.name}}); + {%- elif encodable.is_octet_string -%} + {%- if encodable.is_optional %} + output.append({{field.name}}.isPresent() ? Arrays.toString({{field.name}}.get()) : ""); + {%- else %} + output.append(Arrays.toString({{field.name}})); + {%- endif %} + {%- else %} + output.append({{field.name}}); + {%- endif %} + output.append("\n"); + {%- endfor %} + output.append("}\n"); + return output.toString(); + } +} +{%- endif %} +{%- endfor %} +{%- endfor %} +} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ClusterInfoMapping_java.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ClusterInfoMapping_java.jinja new file mode 100644 index 00000000000000..b3c3a6b2e7d26e --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/java/ClusterInfoMapping_java.jinja @@ -0,0 +1,472 @@ +{%- macro encode_value(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_optional -%} + Optional<{{encode_value(source, encodable.without_optional(), depth + 1)}}> + {%- elif encodable.is_list -%} + ArrayList<{{encode_value(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_remove_generic(source, encodable, depth) -%} + {%- if encodable.is_optional -%} + Optional + {%- elif encodable.is_list -%} + ArrayList + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_remove_generic_optional(source, encodable, depth) -%} + {%- if encodable.is_list -%} + ArrayList + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + @Nullable {{encode_value_without_optional(source, encodable.without_nullable(), depth + 1)}} + {%- elif encodable.is_list -%} + List<{{encode_value_without_optional(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_nullable_arraylist(source, encodable, depth) -%} +{%- if encodable.is_optional -%} + Optional<{{encode_value_without_nullable_arraylist(source, encodable.without_optional(), depth + 1)}}> + {%- elif encodable.is_list -%} + ArrayList<{{encode_value_without_nullable_arraylist(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional_nullable(source, encodable, depth) -%} + {%- if encodable.is_list -%} + List<{{encode_value_without_optional_nullable(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.boxed_java_type}} + {%- endif -%} +{%- endmacro -%} + +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Nullable; +import chip.clusterinfo.ClusterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.DelegatedClusterCallback; +import chip.clusterinfo.ClusterCommandCallback; +import chip.clusterinfo.CommandResponseInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import chip.devicecontroller.ClusterReadMapping; +import chip.devicecontroller.ClusterWriteMapping; + +public class ClusterInfoMapping { + + public static class DelegatedCharStringAttributeCallback implements ChipClusters.CharStringAttributeCallback, DelegatedClusterCallback { + /** Indicates a successful read for a CHAR_STRING attribute. */ + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "String"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOctetStringAttributeCallback implements ChipClusters.OctetStringAttributeCallback, DelegatedClusterCallback { + /** Indicates a successful read for an OCTET_STRING attribute. */ + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "byte[]"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedIntegerAttributeCallback implements ChipClusters.IntegerAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(int value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "int"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedLongAttributeCallback implements ChipClusters.LongAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "long"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedBooleanAttributeCallback implements ChipClusters.BooleanAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(boolean value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "boolean"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedFloatAttributeCallback implements ChipClusters.FloatAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(float value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "float"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedDoubleAttributeCallback implements ChipClusters.DoubleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(double value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "double"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedDefaultClusterCallback implements DefaultClusterCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + // Parameters and list-adds here should be generated - refer to the template code that creates each callback interface. + @Override + public void onSuccess() { + Map responseValues = new LinkedHashMap<>(); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception e) { + callback.onFailure(e); + } + } +{% for cluster in clientClusters | sort(attribute='code') -%} +{%- set typeLookup = idl | createLookupContext(cluster) -%} +{%- set already_handled_command = [] -%} +{% for command in cluster.commands | sort(attribute='code') -%} +{% if command | isCommandNotDefaultCallback() -%} +{% set callbackName = command | javaCommandCallbackName() -%} +{%- if callbackName not in already_handled_command %} + + public static class Delegated{{cluster.name}}Cluster{{callbackName}}Callback implements ChipClusters.{{cluster.name}}Cluster.{{callbackName}}Callback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( +{%- for field in (cluster.structs | named(command.output_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} + {{encode_value(cluster, encodable, 0)}} {{field.name}} + {%- if loop.index0 < loop.length - 1 -%}{{", "}}{%- endif -%} +{%- endfor -%}) { + Map responseValues = new LinkedHashMap<>(); +{% for field in (cluster.structs | named(command.output_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) -%} +{% if encodable.is_list %} + // {{field.name}}: {{encodable.data_type.name}} + // Conversion from this type to Java is not properly implemented yet +{% else -%} +{%- if encodable.is_struct -%} +{%- set struct = encodable.get_underlying_struct() %} + // {{field.name}}: Struct {{struct.name}} + // Conversion from this type to Java is not properly implemented yet +{%- else %} + CommandResponseInfo {{field.name}}ResponseValue = new CommandResponseInfo("{{field.name}}", "{{encode_value_without_nullable_arraylist(cluster, encodable, 0)}}"); + responseValues.put({{field.name}}ResponseValue, {{field.name}}); +{%- endif -%} +{%- endif -%} +{% endfor %} + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } +{%- if already_handled_command.append(callbackName) -%} +{# This block does nothing, it only exists to append to already_handled_command. #} +{%- endif -%} +{%- endif -%} +{%- endif -%} +{% endfor %} + +{%- set already_handled_attribute = [] -%} +{%- for attribute in cluster.attributes | rejectattr('definition', 'is_field_global_name', typeLookup) -%} +{%- set encodable = attribute.definition | asEncodable(typeLookup) -%} +{%- set encodable2 = attribute.definition | asEncodable(typeLookup) -%} +{%- set encodable_check = attribute.definition | asEncodable(typeLookup) -%} +{%- set interfaceName = attribute | javaAttributeCallbackName(typeLookup) -%} +{%- if interfaceName not in already_handled_attribute %} + public static class Delegated{{cluster.name}}Cluster{{attribute.definition.name | upfirst}}AttributeCallback implements ChipClusters.{{cluster.name}}Cluster.{{attribute.definition.name | upfirst}}AttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + {# NOTE: asJavaType ends up sniffing for isArray on the context. Since we want the type of our _entry_, force isArray to false. -#} + @Override + public void onSuccess({{encode_value_without_optional(cluster, encodable, 0)}} {% if encodable_check.is_list -%}valueList{%- else -%}value{%- endif -%}) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("{%- if encodable_check.is_list -%}valueList{%- else -%}value{%- endif -%}", "{{encode_value_without_optional_nullable(cluster, encodable2, 0)}}"); + responseValues.put(commandResponseInfo, {% if encodable_check.is_list -%}valueList{%- else -%}value{%- endif -%}); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } +{% if already_handled_attribute.append(interfaceName) -%} +{# This block does nothing, it only exists to append to already_handled_attribute. #} +{%- endif -%} +{%- endif -%} +{%- endfor -%} +{%- endfor %} + + public Map getClusterMap() { + Map clusterMap = initializeClusterMap(); + Map> commandMap = getCommandMap(); + combineCommand(clusterMap, commandMap); + Map> readAttributeMap = new ClusterReadMapping().getReadAttributeMap(); + combineCommand(clusterMap, readAttributeMap); + Map> writeAttributeMap = new ClusterWriteMapping().getWriteAttributeMap(); + combineCommand(clusterMap, writeAttributeMap); + return clusterMap; + } + + public Map initializeClusterMap() { + Map clusterMap = new HashMap<>(); +{% for cluster in clientClusters | sort(attribute='code') %} + ClusterInfo {{cluster.name | lowfirst}}ClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.{{cluster.name}}Cluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("{{cluster.name | lowfirst}}", {{cluster.name | lowfirst}}ClusterInfo); +{% endfor %} + return clusterMap; + } + + public void combineCommand(Map destination, Map> source) { +{%- for cluster in clientClusters | sort(attribute='code') %} + destination.get("{{cluster.name | lowfirst}}").combineCommands(source.get("{{cluster.name | lowfirst}}")); +{%- endfor %} + } + + @SuppressWarnings("unchecked") + public Map> getCommandMap() { + Map> commandMap = new HashMap<>(); +{% for cluster in clientClusters | sort(attribute='code') -%} +{%- set typeLookup = idl | createLookupContext(cluster) %} + Map {{cluster.name | lowfirst}}ClusterInteractionInfoMap = new LinkedHashMap<>(); +{% for command in cluster.commands | sort(attribute='code') -%} +{%- set callbackName = command | javaCommandCallbackName() %} + Map {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}CommandParams = new LinkedHashMap(); + {#- TODO: fill out parameter types -#} +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) %} +{% if not encodable.is_struct %} + CommandParameterInfo {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}{{field.name | lowfirst_except_acronym}}CommandParameterInfo = new CommandParameterInfo("{{field.name | lowfirst_except_acronym}}", {{encode_value_remove_generic(cluster, encodable, 0)}}.class, {{encode_value_remove_generic_optional(cluster, encodable, 0)}}.class); + {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}CommandParams.put("{{field.name | lowfirst_except_acronym}}",{{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}{{field.name | lowfirst_except_acronym}}CommandParameterInfo); +{%- endif -%} +{% endfor -%} +{%- endif -%} + +{% if command | isCommandNotDefaultCallback() %} + InteractionInfo {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}InteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.{{cluster.name}}Cluster) cluster) + .{{command.name | lowfirst_except_acronym}}((ChipClusters.{{cluster.name}}Cluster.{{callbackName}}Callback) callback +{%- if command.input_param -%} +{% for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) %} + , ({{encode_value_without_nullable_arraylist(cluster, encodable, 0)}}) + commandArguments.get("{{field.name | lowfirst_except_acronym}}") +{% endfor -%} +{%- endif %} + {# TODO: Allow timeout to be passed from client for this and timed write. -#} + {%- if command.is_timed_invoke -%}, 10000{%- endif -%} + ); + }, + () -> new Delegated{{cluster.name}}Cluster{{callbackName}}Callback(), + {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}CommandParams + ); +{%- else %} + InteractionInfo {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}InteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.{{cluster.name}}Cluster) cluster) + .{{command.name | lowfirst_except_acronym}}((DefaultClusterCallback) callback +{%- if command.input_param %} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} +{%- set encodable = field | asEncodable(typeLookup) %} + , ({{encode_value_without_nullable_arraylist(cluster, encodable, 0)}}) + commandArguments.get("{{field.name | lowfirst_except_acronym}}") +{%- endfor -%} +{%- endif -%} + {#- TODO: Allow timeout to be passed from client for this and timed write. -#} + {% if command.is_timed_invoke %}, 10000{%- endif %} + ); + }, + () -> new DelegatedDefaultClusterCallback(), + {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}CommandParams + ); +{%- endif %} + {{cluster.name | lowfirst}}ClusterInteractionInfoMap.put("{{command.name | lowfirst_except_acronym}}", {{cluster.name | lowfirst}}{{command.name | lowfirst_except_acronym}}InteractionInfo); +{% endfor %} + commandMap.put("{{cluster.name | lowfirst}}", {{cluster.name | lowfirst}}ClusterInteractionInfoMap); +{% endfor %} + return commandMap; + } +} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index 4fa6b90c7ce64b..244f77eb2725f9 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -245,6 +245,37 @@ def CommandCallbackName(command: Command, cluster: Cluster): return '{}Cluster{}'.format(cluster.name, command.output_param) +def JavaCommandCallbackName(command: Command): + if command.output_param.lower() == 'defaultsuccess': + return 'DefaultCluster' + return '{}'.format(command.output_param) + + +def IsCommandNotDefaultCallback(command: Command) -> bool: + return command.output_param.lower() != 'defaultsuccess' + + +def JavaAttributeCallbackName(attr: Attribute, context: TypeLookupContext) -> str: + """ + Figure out what callback name to use when building a *AttributeCallback + in java codegen. + """ + global_name = FieldToGlobalName(attr.definition, context) + + if global_name: + return '{}AttributeCallback'.format(GlobalNameToJavaName(global_name)) + + return '{}AttributeCallback'.format(capitalcase(attr.definition.name)) + + +def IsFieldGlobalName(field: Field, context: TypeLookupContext) -> bool: + global_name = FieldToGlobalName(field, context) + if global_name: + return True + + return False + + def attributesWithSupportedCallback(attrs, context: TypeLookupContext): for attr in attrs: # Attributes will be generated for all types @@ -675,6 +706,9 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): self.jinja_env.filters['chipClustersCallbackName'] = ChipClustersCallbackName self.jinja_env.filters['delegatedCallbackName'] = DelegatedCallbackName self.jinja_env.filters['commandCallbackName'] = CommandCallbackName + self.jinja_env.filters['javaCommandCallbackName'] = JavaCommandCallbackName + self.jinja_env.filters['isCommandNotDefaultCallback'] = IsCommandNotDefaultCallback + self.jinja_env.filters['javaAttributeCallbackName'] = JavaAttributeCallbackName self.jinja_env.filters['named'] = NamedFilter self.jinja_env.filters['toBoxedJavaType'] = ToBoxedJavaType self.jinja_env.filters['lowercaseFirst'] = LowercaseFirst @@ -687,6 +721,7 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): self.jinja_env.tests['is_response_struct'] = IsResponseStruct self.jinja_env.tests['is_using_global_callback'] = _IsUsingGlobalCallback + self.jinja_env.tests['is_field_global_name'] = IsFieldGlobalName class JavaJNIGenerator(__JavaCodeGenerator): @@ -796,6 +831,42 @@ def internal_render_all(self): } ) + self.internal_render_one_output( + template_path="ChipClusters_java.jinja", + output_file_name="java/chip/devicecontroller/ChipClusters.java", + vars={ + 'idl': self.idl, + 'clientClusters': clientClusters, + } + ) + + self.internal_render_one_output( + template_path="ChipStructs_java.jinja", + output_file_name="java/chip/devicecontroller/ChipStructs.java", + vars={ + 'idl': self.idl, + 'clientClusters': clientClusters, + } + ) + + self.internal_render_one_output( + template_path="ChipEventStructs_java.jinja", + output_file_name="java/chip/devicecontroller/ChipEventStructs.java", + vars={ + 'idl': self.idl, + 'clientClusters': clientClusters, + } + ) + + self.internal_render_one_output( + template_path="ClusterInfoMapping_java.jinja", + output_file_name="java/chip/devicecontroller/ClusterInfoMapping.java", + vars={ + 'idl': self.idl, + 'clientClusters': clientClusters, + } + ) + self.internal_render_one_output( template_path="ChipStructFiles_gni.jinja", output_file_name="java/chip/devicecontroller/cluster/files.gni", diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja new file mode 100644 index 00000000000000..76fa2eb6b22967 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja @@ -0,0 +1,162 @@ +{%- macro encode_value(source, encodable, depth) -%} + {%- if encodable.is_nullable and encodable.is_optional -%} + {{encode_value(source, encodable.without_nullable().without_optional(), depth + 1)}}? + {%- elif encodable.is_nullable -%} + {{encode_value(source, encodable.without_nullable(), depth + 1)}}? + {%- elif encodable.is_optional -%} + {{encode_value(source, encodable.without_optional(), depth + 1)}}? + {%- elif encodable.is_list -%} + ArrayList<{{encode_value(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.kotlin_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional(source, encodable, depth) -%} + {%- if encodable.is_nullable -%} + {{encode_value_without_optional(source, encodable.without_nullable(), depth + 1)}}? + {%- elif encodable.is_list -%} + List<{{encode_value_without_optional(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.kotlin_type}} + {%- endif -%} +{%- endmacro -%} + +{%- macro encode_value_without_optional_nullable(source, encodable, depth) -%} + {%- if encodable.is_list -%} + ArrayList<{{encode_value_without_optional_nullable(source, encodable.without_list(), depth + 1)}}> + {%- elif encodable.is_struct -%} + {%- set struct = encodable.get_underlying_struct() -%} + ChipStructs.{{source.name}}Cluster{{struct.name}} + {%- else -%} + {{encodable.kotlin_type}} + {%- endif -%} +{%- endmacro -%} + +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.devicecontroller.cluster.clusters + +import java.util.ArrayList +{% set typeLookup = idl | createLookupContext(cluster) %} +class {{cluster.name}}Cluster(private val endpointId: UShort) { + +{%- set already_handled_command = [] -%} +{%- for command in cluster.commands | sort(attribute='code') -%} +{%- if command | isCommandNotDefaultCallback() -%} +{%- set callbackName = command | javaCommandCallbackName() -%} +{%- if callbackName not in already_handled_command %} + class {{callbackName}}( +{%- for field in (cluster.structs | named(command.output_param)).fields %} + val {{field.name | lowfirst_except_acronym}}: {{encode_value(cluster, field | asEncodable(typeLookup), 0)}} +{%- if not loop.last %}, {% endif %} +{%- endfor %} + ) +{% if already_handled_command.append(callbackName) -%} +{%- endif -%} +{%- endif -%} +{%- endif -%} +{%- endfor %} + +{%- set already_handled_attribute = [] -%} +{% for attribute in cluster.attributes | rejectattr('definition', 'is_field_global_name', typeLookup) %} +{%- set encodable = attribute.definition | asEncodable(typeLookup) -%} +{%- set interfaceName = attribute | javaAttributeCallbackName(typeLookup) -%} +{%- if interfaceName not in already_handled_attribute %} + class {{interfaceName}}( + val value: {{encode_value(cluster, encodable, 0)}} + ) +{% if already_handled_attribute.append(interfaceName) -%} +{#- This block does nothing, it only exists to append to already_handled_attribute. -#} +{%- endif -%} +{%- endif -%} +{% endfor -%} + +{% for command in cluster.commands | sort(attribute='code') -%} +{%- set callbackName = command | javaCommandCallbackName() %} + suspend fun {{command.name | lowfirst_except_acronym}}( +{%- if command.input_param -%} +{%- for field in (cluster.structs | named(command.input_param)).fields -%} + {{field.name | lowfirst_except_acronym}}: {{encode_value(cluster, field | asEncodable(typeLookup), 0)}} +{%- if not loop.last -%}, {% endif %} +{%- endfor -%} + , timedInvokeTimeoutMs: Int? = null) +{%- else -%} + timedInvokeTimeoutMs: Int? = null) +{%- endif -%} +{%- if command | hasResponse -%} + : {{callbackName}} { +{%- else %} { +{%- endif %} + if (timedInvokeTimeoutMs != null) { + // Do the action with timedInvokeTimeoutMs + } else { + // Do the action without timedInvokeTimeoutMs + } + } +{% endfor -%} + +{% for attribute in cluster.attributes | sort(attribute='code') %} +{%- set interfaceName = attribute | javaAttributeCallbackName(typeLookup) %} + suspend fun read{{ attribute.definition.name | upfirst }}Attribute(): {{interfaceName}} { + // Implementation needs to be added here + } +{% if attribute | isFabricScopedList(typeLookup) %} + suspend fun read{{ attribute.definition.name | upfirst }}AttributeWithFabricFilter( + isFabricFiltered: Boolean + ): {{interfaceName}} { + // Implementation needs to be added here + } + +{% endif -%} +{%- if attribute.is_writable %} +{%- set encodable = attribute.definition | asEncodable(typeLookup) -%} +{%- set encodable2 = attribute.definition | asEncodable(typeLookup) -%} +{%- if not attribute.requires_timed_write %} + suspend fun write{{ attribute.definition.name | upfirst }}Attribute( + value: {{ encode_value_without_optional_nullable(cluster, encodable, 0) }} + ) { + // Implementation needs to be added here + } +{% endif %} + suspend fun write{{ attribute.definition.name | upfirst }}Attribute( + value: {{ encode_value_without_optional_nullable(cluster, encodable2, 0) }}, + timedWriteTimeoutMs: Int + ) { + // Implementation needs to be added here + } +{% endif %} +{%- if attribute.is_subscribable %} + suspend fun subscribe{{ attribute.definition.name | upfirst }}Attribute( + minInterval: Int, + maxInterval: Int + ): {{interfaceName}} { + // Implementation needs to be added here + } +{% endif -%} +{%- endfor %} + companion object { + const val CLUSTER_ID: UInt = {{cluster.code}}u + } +} diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterFiles_gni.jinja b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterFiles_gni.jinja new file mode 100644 index 00000000000000..b9fbf099f29eed --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterFiles_gni.jinja @@ -0,0 +1,9 @@ +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +matter_clusters_sources = [ +{%- for cluster in clientClusters | sort(attribute='name') %} +{%- set typeLookup = idl | createLookupContext(cluster) %} + "${chip_root}/src/controller/java/generated/java/matter/devicecontroller/cluster/clusters/{{cluster.name}}Cluster.kt", +{%- endfor %} +] \ No newline at end of file diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py new file mode 100644 index 00000000000000..025a314685367e --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py @@ -0,0 +1,677 @@ +#!/usr/bin/env python +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import dataclasses +import enum +import logging +import os +from typing import List, Optional, Set + +from matter_idl.generators import CodeGenerator, GeneratorStorage +from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType, + ParseDataType, TypeLookupContext) +from matter_idl.matter_idl_types import (Attribute, Cluster, ClusterSide, Command, DataType, Field, FieldQuality, Idl, Struct, + StructQuality, StructTag) +from stringcase import capitalcase + + +@dataclasses.dataclass +class GenerateTarget: + template: str + output_name: str + + +@dataclasses.dataclass +class GlobalType: + name: str # java name + cpp_type: str # underlying type + idl_type: str # assumed IDL type + + +# types that java should see globally +_GLOBAL_TYPES = [ + GlobalType("Boolean", "bool", "boolean"), + GlobalType("CharString", "const chip::CharSpan", "char_string"), + GlobalType("Double", "double", "double"), + GlobalType("Float", "float", "single"), + GlobalType("Int8s", "int8_t", "int8s"), + GlobalType("Int8u", "uint8_t", "int8u"), + GlobalType("Int16s", "int16_t", "int16s"), + GlobalType("Int16u", "uint16_t", "int16u"), + GlobalType("Int32s", "int32_t", "int32s"), + GlobalType("Int32u", "uint32_t", "int32u"), + GlobalType("Int64s", "int64_t", "int64s"), + GlobalType("Int64u", "uint64_t", "int64u"), + GlobalType("OctetString", "const chip::ByteSpan", "octet_string"), +] + + +def _UnderlyingType(field: Field, context: TypeLookupContext) -> Optional[str]: + actual = ParseDataType(field.data_type, context) + if isinstance(actual, (IdlEnumType, IdlBitmapType)): + actual = actual.base_type + + if isinstance(actual, BasicString): + if actual.is_binary: + return 'OctetString' + else: + return 'CharString' + elif isinstance(actual, BasicInteger): + if actual.is_signed: + return "Int{}s".format(actual.power_of_two_bits) + else: + return "Int{}u".format(actual.power_of_two_bits) + elif isinstance(actual, FundamentalType): + if actual == FundamentalType.BOOL: + return 'Boolean' + elif actual == FundamentalType.FLOAT: + return 'Float' + elif actual == FundamentalType.DOUBLE: + return 'Double' + else: + logging.warn('Unknown fundamental type: %r' % actual) + + return None + + +def FieldToGlobalName(field: Field, context: TypeLookupContext) -> Optional[str]: + """Global names are used for generic callbacks shared across + all clusters (e.g. for bool/float/uint32 and similar) + """ + if field.is_list: + return None # lists are always specific per cluster + + if FieldQuality.NULLABLE & field.qualities: + return None + + return _UnderlyingType(field, context) + + +# Based on atomicType in ZAP: +# src-electron/generator/matter/app/zap-templates/common/override.js +_KNOWN_DECODABLE_TYPES = { + 'action_id': 'chip::ActionId', + 'attrib_id': 'chip::AttributeId', + 'cluster_id': 'chip::ClusterId', + 'command_id': 'chip::CommandId', + 'data_ver': 'chip::DataVersion', + 'devtype_id': 'chip::DeviceTypeId', + 'endpoint_no': 'chip::EndpointId', + 'eui64': 'chip::NodeId', + 'event_id': 'chip::EventId', + 'event_no': 'chip::EventNumber', + 'fabric_id': 'chip::FabricId', + 'fabric_idx': 'chip::FabricIndex', + 'fabric_idx': 'chip::FabricIndex', + 'field_id': 'chip::FieldId', + 'group_id': 'chip::GroupId', + 'node_id': 'chip::NodeId', + 'percent': 'chip::Percent', + 'percent100ths': 'chip::Percent100ths', + 'transaction_id': 'chip::TransactionId', + 'vendor_id': 'chip::VendorId', + + # non-named enums + 'enum8': 'uint8_t', + 'enum16': 'uint16_t', + 'enum32': 'uint32_t', + 'enum64': 'uint64_t', +} + + +def GlobalNameToJavaName(name: str) -> str: + if name == 'Int8s': + return 'Byte' + if name == 'Int8u': + return 'UByte' + if name == 'Int16s': + return 'Short' + if name == 'Int16u': + return 'UShort' + + if name == 'Int32s': + return 'Int' + if name == 'Int32u': + return 'UInt' + if name == 'Int64s': + return 'Long' + if name == 'Int64u': + return 'ULong' + + # Double/Float/Boolean/CharString/OctetString + return name + + +def DelegatedCallbackName(attr: Attribute, context: TypeLookupContext) -> str: + """ + Figure out what callback name to use for delegate callback construction. + """ + global_name = FieldToGlobalName(attr.definition, context) + + if global_name: + return 'Delegated{}AttributeCallback'.format(GlobalNameToJavaName(global_name)) + + return 'Delegated{}Cluster{}AttributeCallback'.format(context.cluster.name, capitalcase(attr.definition.name)) + + +def ChipClustersCallbackName(attr: Attribute, context: TypeLookupContext) -> str: + """ + Figure out what callback name to use when building a ChipCluster.*AttributeCallback + in java codegen. + """ + global_name = FieldToGlobalName(attr.definition, context) + + if global_name: + return 'ChipClusters.{}AttributeCallback'.format(GlobalNameToJavaName(global_name)) + + return 'ChipClusters.{}Cluster.{}AttributeCallback'.format(context.cluster.name, capitalcase(attr.definition.name)) + + +def CallbackName(attr: Attribute, context: TypeLookupContext) -> str: + """ + Figure out what callback name to use when a variable requires a read callback. + + These are split into native types, like Boolean/Float/Double/CharString, where + one callback type can support anything. + + For specific types (e.g. A struct) codegen will generate its own callback name + specific to that type. + """ + global_name = FieldToGlobalName(attr.definition, context) + + if global_name: + return 'CHIP{}AttributeCallback'.format(capitalcase(global_name)) + + return 'CHIP{}{}AttributeCallback'.format( + capitalcase(context.cluster.name), + capitalcase(attr.definition.name) + ) + + +def CommandCallbackName(command: Command, cluster: Cluster): + if command.output_param.lower() == 'defaultsuccess': + return 'DefaultSuccess' + return '{}Cluster{}'.format(cluster.name, command.output_param) + + +def JavaCommandCallbackName(command: Command): + if command.output_param.lower() == 'defaultsuccess': + return 'DefaultCluster' + return '{}'.format(command.output_param) + + +def IsCommandNotDefaultCallback(command: Command) -> bool: + return command.output_param.lower() != 'defaultsuccess' + + +def JavaAttributeCallbackName(attr: Attribute, context: TypeLookupContext) -> str: + """ + Figure out what callback name to use when building a *AttributeCallback + in java codegen. + """ + global_name = FieldToGlobalName(attr.definition, context) + + if global_name: + return '{}'.format(GlobalNameToJavaName(global_name)) + + return '{}Attribute'.format(capitalcase(attr.definition.name)) + + +def IsFieldGlobalName(field: Field, context: TypeLookupContext) -> bool: + global_name = FieldToGlobalName(field, context) + if global_name: + return True + + return False + + +def attributesWithSupportedCallback(attrs, context: TypeLookupContext): + for attr in attrs: + # Attributes will be generated for all types + # except non-list structures + if not attr.definition.is_list: + underlying = ParseDataType(attr.definition.data_type, context) + if isinstance(underlying, IdlType): + continue + + yield attr + + +def _IsUsingGlobalCallback(field: Field, context: TypeLookupContext): + """Test to determine if the data type of a field can use one of + the global callbacks (i.e. it is a basic double/integer/bool etc.) + """ + if field.is_list: + return False + + if field.is_nullable: + return False + + return field.data_type.name in { + "boolean", + "single", + "double", + "int8s", + "int8u", + "int16s", + "int16u", + "int24s", + "int24u", + "int32s", + "int32u", + "int40s", + "int40u", + "int48s", + "int48u", + "int56s", + "int56u", + "int64s", + "int64u", + "enum8", + "enum16", + "enum32", + "enum64", + "bitmap8", + "bitmap16", + "bitmap32", + "bitmap64", + "char_string", + "long_char_string", + "octet_string", + "long_octet_string", + } + + +def NamedFilter(choices: List, name: str): + for choice in choices: + if choice.name == name: + return choice + raise Exception("No item named %s in %r" % (name, choices)) + + +def ToBoxedJavaType(field: Field): + if field.is_optional: + return 'jobject' + elif field.data_type.name.lower() in ['octet_string', 'long_octet_string']: + return 'jbyteArray' + elif field.data_type.name.lower() in ['char_string', 'long_char_string']: + return 'jstring' + else: + return 'jobject' + + +def LowercaseFirst(name: str) -> str: + """ + Change the first letter of a string to lowercase as long as the 2nd + letter is not uppercase. + + Can be used for variable naming, eg insider structures, codegen will + call things "Foo foo" (notice variable name is lowercase). + """ + if len(name) > 1 and name[1].lower() != name[1]: + # Odd workaround: PAKEVerifier should not become pAKEVerifier + return name + return name[0].lower() + name[1:] + + +class EncodableValueAttr(enum.Enum): + LIST = enum.auto() + NULLABLE = enum.auto() + OPTIONAL = enum.auto() + + +class EncodableValue: + """ + Contains helpers for encoding values, specifically lookups + for optionality, lists and recursive data type lookups within + the IDL and cluster + + Intended use is to be able to: + - derive types (see clone and without_* methods) such that codegen + can implement things like 'if x != null { treat non-null x}' + - Java specific conversions: get boxed types and JNI string signautes + for the underlying types. + """ + + def __init__(self, context: TypeLookupContext, data_type: DataType, attrs: Set[EncodableValueAttr]): + self.context = context + self.data_type = data_type + self.attrs = attrs + + @property + def is_nullable(self): + return EncodableValueAttr.NULLABLE in self.attrs + + @property + def is_optional(self): + return EncodableValueAttr.OPTIONAL in self.attrs + + @property + def is_list(self): + return EncodableValueAttr.LIST in self.attrs + + @property + def is_octet_string(self): + return self.data_type.name.lower() in ['octet_string', 'long_octet_string'] + + @property + def is_char_string(self): + return self.data_type.name.lower() in ['char_string', 'long_char_string'] + + @property + def is_struct(self): + return self.context.is_struct_type(self.data_type.name) + + @property + def is_enum(self): + return self.context.is_enum_type(self.data_type.name) + + @property + def is_bitmap(self): + return self.context.is_bitmap_type(self.data_type.name) + + @property + def is_untyped_bitmap(self): + return self.context.is_untyped_bitmap_type(self.data_type.name) + + def clone(self): + return EncodableValue(self.context, self.data_type, self.attrs) + + def without_nullable(self): + result = self.clone() + result.attrs.remove(EncodableValueAttr.NULLABLE) + return result + + def without_optional(self): + result = self.clone() + result.attrs.remove(EncodableValueAttr.OPTIONAL) + return result + + def without_list(self): + result = self.clone() + result.attrs.remove(EncodableValueAttr.LIST) + return result + + def get_underlying_struct(self): + s = self.context.find_struct(self.data_type.name) + if not s: + raise Exception("Struct %s not found" % self.data_type.name) + return s + + def get_underlying_enum(self): + e = self.context.find_enum(self.data_type.name) + if not e: + raise Exception("Enum %s not found" % self.data_type.name) + return e + + @property + def kotlin_type(self): + t = ParseDataType(self.data_type, self.context) + + if isinstance(t, FundamentalType): + if t == FundamentalType.BOOL: + return "Boolean" + elif t == FundamentalType.FLOAT: + return "Float" + elif t == FundamentalType.DOUBLE: + return "Double" + else: + raise Exception("Unknown fundamental type") + elif isinstance(t, BasicInteger): + if t.is_signed: + if t.byte_count <= 1: + return "Byte" + if t.byte_count <= 2: + return "Short" + if t.byte_count <= 4: + return "Int" + return "Long" + else: # unsigned + if t.byte_count <= 1: + return "UByte" + if t.byte_count <= 2: + return "UShort" + if t.byte_count <= 4: + return "UInt" + return "ULong" + elif isinstance(t, BasicString): + if t.is_binary: + return "ByteArray" + else: + return "String" + elif isinstance(t, IdlEnumType): + if t.base_type.byte_count >= 3: + return "ULong" + else: + return "UInt" + elif isinstance(t, IdlBitmapType): + if t.base_type.byte_count >= 3: + return "ULong" + else: + return "UInt" + else: + return "Any" + + @property + def unboxed_java_signature(self): + if self.is_optional or self.is_list: + raise Exception("Not a basic type: %r" % self) + + t = ParseDataType(self.data_type, self.context) + + if isinstance(t, FundamentalType): + if t == FundamentalType.BOOL: + return "Z" + elif t == FundamentalType.FLOAT: + return "F" + elif t == FundamentalType.DOUBLE: + return "D" + else: + raise Exception("Unknown fundamental type") + elif isinstance(t, BasicInteger): + if t.byte_count >= 3: + return "J" + else: + return "I" + else: + raise Exception("Not a basic type: %r" % self) + + @property + def boxed_java_signature(self): + # Optional takes precedence over list - Optional compiles down to just java.util.Optional. + if self.is_optional: + return "Ljava/util/Optional;" + + if self.is_list: + return "Ljava/util/ArrayList;" + + t = ParseDataType(self.data_type, self.context) + + if isinstance(t, FundamentalType): + if t == FundamentalType.BOOL: + return "Ljava/lang/Boolean;" + elif t == FundamentalType.FLOAT: + return "Ljava/lang/Float;" + elif t == FundamentalType.DOUBLE: + return "Ljava/lang/Double;" + else: + raise Exception("Unknown fundamental type") + elif isinstance(t, BasicInteger): + if t.byte_count >= 3: + return "Ljava/lang/Long;" + else: + return "Ljava/lang/Integer;" + elif isinstance(t, BasicString): + if t.is_binary: + return "[B" + else: + return "Ljava/lang/String;" + elif isinstance(t, IdlEnumType): + if t.base_type.byte_count >= 3: + return "Ljava/lang/Long;" + else: + return "Ljava/lang/Integer;" + elif isinstance(t, IdlBitmapType): + if t.base_type.byte_count >= 3: + return "Ljava/lang/Long;" + else: + return "Ljava/lang/Integer;" + else: + return "Lchip/devicecontroller/ChipStructs${}Cluster{};".format(self.context.cluster.name, self.data_type.name) + + +def GlobalEncodableValueFrom(typeName: str, context: TypeLookupContext) -> EncodableValue: + """ + Filter to convert a global type name to an encodable value + """ + return EncodableValue(context, DataType(name=typeName), set()) + + +def EncodableValueFrom(field: Field, context: TypeLookupContext) -> EncodableValue: + """ + Filter to convert a standard field to an EncodableValue. + + This converts the AST information (field name/info + lookup context) into + a java-generator specific wrapper that can be manipulated and + queried for properties like java native name or JNI string signature. + """ + attrs = set() + + if field.is_optional: + attrs.add(EncodableValueAttr.OPTIONAL) + + if field.is_nullable: + attrs.add(EncodableValueAttr.NULLABLE) + + if field.is_list: + attrs.add(EncodableValueAttr.LIST) + + return EncodableValue(context, field.data_type, attrs) + + +def CreateLookupContext(idl: Idl, cluster: Optional[Cluster]) -> TypeLookupContext: + """ + A filter to mark a lookup context to be within a specific cluster. + + This is used to specify how structure/enum/other names are looked up. + Generally one looks up within the specific cluster then if cluster does + not contain a definition, we loop at global namespacing. + """ + return TypeLookupContext(idl, cluster) + + +def CanGenerateSubscribe(attr: Attribute, lookup: TypeLookupContext) -> bool: + """ + Filter that returns if an attribute can be subscribed to. + + Uses the given attribute and the lookupContext to figure out the attribute + type. + """ + # For backwards compatibility, we do not subscribe to structs + # (although list of structs is ok ...) + if attr.definition.is_list: + return True + + return not lookup.is_struct_type(attr.definition.data_type.name) + + +def IsFabricScopedList(attr: Attribute, lookup: TypeLookupContext) -> bool: + if not attr.definition.is_list: + return False + + struct = lookup.find_struct(attr.definition.data_type.name) + return struct and struct.qualities == StructQuality.FABRIC_SCOPED + + +def CommandHasResponse(command: Command) -> bool: + """Returns true if a command has a specific response.""" + return command.output_param != "DefaultSuccess" + + +def IsResponseStruct(s: Struct) -> bool: + return s.tag == StructTag.RESPONSE + + +class __KotlinCodeGenerator(CodeGenerator): + """ + Code generation for kotlin-specific files. + + Registers filters used by all kotlin generators. + """ + + def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): + """ + Inintialization is specific for kotlin generation and will add + filters as required by the kotlin .jinja templates to function. + """ + super().__init__(storage, idl, fs_loader_searchpath=os.path.dirname(__file__)) + + self.jinja_env.filters['attributesWithCallback'] = attributesWithSupportedCallback + self.jinja_env.filters['callbackName'] = CallbackName + self.jinja_env.filters['chipClustersCallbackName'] = ChipClustersCallbackName + self.jinja_env.filters['delegatedCallbackName'] = DelegatedCallbackName + self.jinja_env.filters['commandCallbackName'] = CommandCallbackName + self.jinja_env.filters['javaCommandCallbackName'] = JavaCommandCallbackName + self.jinja_env.filters['isCommandNotDefaultCallback'] = IsCommandNotDefaultCallback + self.jinja_env.filters['javaAttributeCallbackName'] = JavaAttributeCallbackName + self.jinja_env.filters['named'] = NamedFilter + self.jinja_env.filters['toBoxedJavaType'] = ToBoxedJavaType + self.jinja_env.filters['lowercaseFirst'] = LowercaseFirst + self.jinja_env.filters['asEncodable'] = EncodableValueFrom + self.jinja_env.filters['globalAsEncodable'] = GlobalEncodableValueFrom + self.jinja_env.filters['createLookupContext'] = CreateLookupContext + self.jinja_env.filters['canGenerateSubscribe'] = CanGenerateSubscribe + self.jinja_env.filters['isFabricScopedList'] = IsFabricScopedList + self.jinja_env.filters['hasResponse'] = CommandHasResponse + + self.jinja_env.tests['is_response_struct'] = IsResponseStruct + self.jinja_env.tests['is_using_global_callback'] = _IsUsingGlobalCallback + self.jinja_env.tests['is_field_global_name'] = IsFieldGlobalName + + +class KotlinClassGenerator(__KotlinCodeGenerator): + """Generates .kt files """ + + def __init__(self, *args, **kargs): + super().__init__(*args, **kargs) + + def internal_render_all(self): + """ + Renders .kt files required for kotlin matter support + """ + + clientClusters = [ + c for c in self.idl.clusters if c.side == ClusterSide.CLIENT] + + self.internal_render_one_output( + template_path="MatterFiles_gni.jinja", + output_file_name="java/matter/devicecontroller/cluster/files.gni", + vars={ + 'idl': self.idl, + 'clientClusters': clientClusters, + } + ) + + # Generate a `.kt` file for each cluster. + for cluster in clientClusters: + output_name = f"java/matter/devicecontroller/cluster/clusters/{cluster.name}Cluster.kt" + self.internal_render_one_output( + template_path="MatterClusters.jinja", + output_file_name=output_name, + vars={ + 'idl': self.idl, + 'cluster': cluster, + } + ) diff --git a/scripts/py_matter_idl/matter_idl/generators/registry.py b/scripts/py_matter_idl/matter_idl/generators/registry.py index e3c8e1ed32397e..c91981e8ad7391 100644 --- a/scripts/py_matter_idl/matter_idl/generators/registry.py +++ b/scripts/py_matter_idl/matter_idl/generators/registry.py @@ -17,7 +17,9 @@ from matter_idl.generators.cpp.application import CppApplicationGenerator from matter_idl.generators.cpp.tlvmeta import TLVMetaDataGenerator +from matter_idl.generators.idl import IdlGenerator from matter_idl.generators.java import JavaClassGenerator, JavaJNIGenerator +from matter_idl.generators.kotlin import KotlinClassGenerator class CodeGenerator(enum.Enum): @@ -28,8 +30,10 @@ class CodeGenerator(enum.Enum): """ JAVA_JNI = enum.auto() JAVA_CLASS = enum.auto() + KOTLIN_CLASS = enum.auto() CPP_APPLICATION = enum.auto() CPP_TLVMETA = enum.auto() + IDL = enum.auto() CUSTOM = enum.auto() def Create(self, *args, **kargs): @@ -37,10 +41,14 @@ def Create(self, *args, **kargs): return JavaJNIGenerator(*args, **kargs) elif self == CodeGenerator.JAVA_CLASS: return JavaClassGenerator(*args, **kargs) + elif self == CodeGenerator.KOTLIN_CLASS: + return KotlinClassGenerator(*args, **kargs) elif self == CodeGenerator.CPP_APPLICATION: return CppApplicationGenerator(*args, **kargs) elif self == CodeGenerator.CPP_TLVMETA: return TLVMetaDataGenerator(*args, **kargs) + elif self == CodeGenerator.IDL: + return IdlGenerator(*args, **kargs) elif self == CodeGenerator.CUSTOM: # Use a package naming convention to find the custom generator: # ./matter_idl_plugin/__init__.py defines a subclass of CodeGenerator named CustomGenerator. @@ -68,7 +76,9 @@ def FromString(name): GENERATORS = { 'java-jni': CodeGenerator.JAVA_JNI, 'java-class': CodeGenerator.JAVA_CLASS, + 'kotlin-class': CodeGenerator.KOTLIN_CLASS, 'cpp-app': CodeGenerator.CPP_APPLICATION, 'cpp-tlvmeta': CodeGenerator.CPP_TLVMETA, + 'idl': CodeGenerator.IDL, 'custom': CodeGenerator.CUSTOM, } diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index 0d1bfb8d869e49..ba909cb8fd24a8 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -46,6 +46,14 @@ def appply_to_idl(self, idl: Idl, content: str): while content[actual_pos] in ' \t\n\r': actual_pos += 1 + # Allow to skip api maturity flags + for maturity in ["provisional", "internal", "stable", "deprecated"]: + if content[actual_pos:].startswith(maturity): + actual_pos += len(maturity) + + while content[actual_pos] in ' \t\n\r': + actual_pos += 1 + # A doc comment will apply to any supported element assuming it immediately # preceeds id (skipping whitespace) for item in self.supported_types(idl): @@ -302,10 +310,10 @@ def command_with_access(self, args): # NOTE: awkward inline because the order of 'meta, children' vs 'children, meta' was flipped # between lark versions in https://github.com/lark-parser/lark/pull/993 @v_args(meta=True, inline=True) - def command(self, meta, *args): + def command(self, meta, *tuple_args): # The command takes 4 arguments if no input argument, 5 if input # argument is provided - args = list(args) # convert from tuple + args = list(tuple_args) # convert from tuple if len(args) != 5: args.insert(2, None) diff --git a/scripts/py_matter_idl/matter_idl/test_data_model_xml.py b/scripts/py_matter_idl/matter_idl/test_data_model_xml.py new file mode 100755 index 00000000000000..6117f35e9f1ad2 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/test_data_model_xml.py @@ -0,0 +1,661 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import io +import unittest +from difflib import unified_diff +from typing import List, Optional, Union + +try: + from matter_idl.data_model_xml import ParseSource, ParseXmls +except ImportError: + import os + import sys + + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_idl.data_model_xml import ParseSource, ParseXmls + +from matter_idl.generators import GeneratorStorage +from matter_idl.generators.idl import IdlGenerator +from matter_idl.matter_idl_parser import CreateParser +from matter_idl.matter_idl_types import Idl + + +class GeneratorContentStorage(GeneratorStorage): + def __init__(self): + super().__init__() + self.content: Optional[str] = None + + def get_existing_data(self, relative_path: str): + # Force re-generation each time + return None + + def write_new_data(self, relative_path: str, content: str): + if self.content: + raise Exception( + "Unexpected extra data: single file generation expected") + self.content = content + + +def RenderAsIdlTxt(idl: Idl) -> str: + storage = GeneratorContentStorage() + IdlGenerator(storage=storage, idl=idl).render(dry_run=False) + return storage.content or "" + + +def XmlToIdl(what: Union[str, List[str]]) -> Idl: + if not isinstance(what, list): + what = [what] + + sources = [] + for idx, txt in enumerate(what): + sources.append(ParseSource(source=io.StringIO( + txt), name=("Input %d" % (idx + 1)))) + + return ParseXmls(sources, include_meta_data=False) + + +def IdlTextToIdl(what: str) -> Idl: + return CreateParser(skip_meta=True).parse(what) + + +class TestXmlParser(unittest.TestCase): + + def __init__(self, *args, **kargs): + super().__init__(*args, **kargs) + self.maxDiff = None + + def assertIdlEqual(self, a: Idl, b: Idl): + if a == b: + # seems the same. This will just pass + self.assertEqual(a, b) + return + + # Not the same. Try to make a human readable diff: + a_txt = RenderAsIdlTxt(a) + b_txt = RenderAsIdlTxt(b) + + delta = unified_diff(a_txt.splitlines(keepends=True), + b_txt.splitlines(keepends=True), + fromfile='actual.matter', + tofile='expected.matter', + ) + self.assertEqual(a, b, '\n' + ''.join(delta)) + + def testBasicInput(self): + + xml_idl = XmlToIdl(''' + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Test = 123 { + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testClusterDerivation(self): + # This test is based on a subset of ModeBase and Mode_Dishwasher original xml files + + xml_idl = XmlToIdl([ + # base ... + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''', + # derived ... + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + + ''', + ]) + + expected_idl = IdlTextToIdl(''' + client cluster DishwasherMode = 89 { + bitmap Feature: bitmap32 { + kOnOff = 0x1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + // baseline inserted after, so to pass the test add this at the end + readonly attribute ModeOptionStruct supportedModes[] = 0; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testSignedTypes(self): + + xml_idl = XmlToIdl(''' + + + + + + + + + + + + + + + + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Test = 123 { + readonly attribute int16s first = 0; + readonly attribute int16s second = 1; + readonly attribute int32u third = 2; + + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testEnumRange(self): + # Check heuristic for enum ranges + + xml_idl = XmlToIdl(''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Test = 123 { + bitmap Basic: bitmap8 { + kOne = 0x01; + kTwo = 0x02; + kThree = 0x04; + } + + bitmap OneLarge: bitmap16 { + kTen = 0x400; + } + + bitmap LargeBitmap: bitmap32 { + kOne = 0x1; + kTen = 0x400; + kTwenty = 0x100000; + } + + bitmap HugeBitmap: bitmap64 { + kForty = 0x10000000000; + } + + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testAttributes(self): + # Validate an attribute with a type list + # This is a very stripped down version from the original AudioOutput.xml + + xml_idl = XmlToIdl(''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Test = 123 { + struct OutputInfoStruct { + int8u index = 0; + } + + readonly attribute OutputInfoStruct outputList[] = 0; + readonly attribute optional enum8 testConform = 1; + + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testXmlNameWorkarounds(self): + # Validate an attribute with a type list + # This is a manually-edited copy of an attribute test (not real data) + + xml_idl = XmlToIdl(''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Test = 123 { + struct OutputInfoStruct { + char_string id = 0; + int8u items[] = 1; + endpoint_no endpoints[] = 2; + } + + readonly attribute OutputInfoStruct outputList[] = 0; + readonly attribute optional enum8 testConform = 1; + + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + def testComplexInput(self): + # This parses a known copy of Switch.xml which happens to be fully + # spec-conformant (so assuming it as a good input) + xml_idl = XmlToIdl(''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''') + + expected_idl = IdlTextToIdl(''' + client cluster Switch = 59 { + bitmap Feature : bitmap32 { + kLatchingSwitch = 0x1; + kMomentarySwitch = 0x2; + kMomentarySwitchRelease = 0x4; + kMomentarySwitchLongPress = 0x8; + kMomentarySwitchMultiPress = 0x10; + } + + info event SwitchLatched = 0 { + int8u newPosition = 0; + } + + info event InitialPress = 1 { + int8u newPosition = 0; + } + + info event LongPress = 2 { + int8u newPosition = 0; + } + + info event ShortRelease = 3 { + int8u previousPosition = 0; + } + + info event LongRelease = 4 { + int8u previousPosition = 0; + } + + info event MultiPressOngoing = 5 { + int8u newPosition = 0; + int8u currentNumberOfPressesCounted = 1; + } + + info event MultiPressComplete = 6 { + int8u previousPosition = 0; + int8u totalNumberOfPressesCounted = 1; + } + + readonly attribute int8u numberOfPositions = 0; + readonly attribute int8u currentPosition = 1; + readonly attribute optional int8u multiPressMax = 2; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute event_id eventList[] = 65530; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + } + ''') + + self.assertIdlEqual(xml_idl, expected_idl) + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/py_matter_idl/matter_idl/test_idl_generator.py b/scripts/py_matter_idl/matter_idl/test_idl_generator.py new file mode 100755 index 00000000000000..ea1347fb0e7d4c --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/test_idl_generator.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2022 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 os +import sys +import unittest +from typing import Optional + +try: + from matter_idl.matter_idl_parser import CreateParser +except ImportError: + + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_idl.matter_idl_parser import CreateParser + +from matter_idl.generators import GeneratorStorage +from matter_idl.generators.idl import IdlGenerator +from matter_idl.matter_idl_types import Idl + + +class TestCaseStorage(GeneratorStorage): + def __init__(self): + super().__init__() + self.content: Optional[str] = None + + def get_existing_data(self, relative_path: str): + # Force re-generation each time + return None + + def write_new_data(self, relative_path: str, content: str): + if self.content: + raise Exception("Unexpected extra data: single file generation expected") + self.content = content + + +def ReadMatterIdl(repo_path: str) -> Idl: + path = os.path.join(os.path.dirname(__file__), "../../..", repo_path) + with open(path, "rt") as stream: + return stream.read() + + +def ParseMatterIdl(repo_path: str, skip_meta: bool) -> Idl: + return CreateParser(skip_meta=skip_meta).parse(ReadMatterIdl(repo_path)) + + +def RenderAsIdlTxt(idl: Idl) -> str: + storage = TestCaseStorage() + IdlGenerator(storage=storage, idl=idl).render(dry_run=False) + return storage.content + + +def SkipLeadingComments(txt: str) -> str: + """Skips leading lines starting with // in a file. """ + lines = txt.split("\n") + idx = 0 + while lines[idx].startswith("//") or not lines[idx]: + idx = idx + 1 + return "\n".join(lines[idx:]) + + +class TestIdlRendering(unittest.TestCase): + def test_client_clusters(self): + # IDL renderer was updated to have IDENTICAL output for client side + # cluster rendering, so this diff will be verbatim + # + # Comparison made text-mode so that meta-data is read and doc-comments are + # available + + path = "src/controller/data_model/controller-clusters.matter" + + # Files MUST be identical except the header comments which are different + original = SkipLeadingComments(ReadMatterIdl(path)) + generated = SkipLeadingComments(RenderAsIdlTxt(ParseMatterIdl(path, skip_meta=False))) + + self.assertEqual(original, generated) + + def test_app_rendering(self): + # When endpoints are involved, default value formatting is lost + # (e.g. "0x0000" becomes "0") and ordering of emitted events is not preserved + # because the events are a + + # as such, this test validates that parsing + generating + re-parsing results + # in the same data being parsed + test_paths = [ + "examples/lock-app/lock-common/lock-app.matter", + "examples/lighting-app/lighting-common/lighting-app.matter", + "examples/all-clusters-app/all-clusters-common/all-clusters-app.matter", + "examples/thermostat/thermostat-common/thermostat.matter", + ] + + for path in test_paths: + idl = ParseMatterIdl(path, skip_meta=True) + txt = RenderAsIdlTxt(idl) + idl2 = CreateParser(skip_meta=True).parse(txt) + + # checks that data types and content is the same + self.assertEqual(idl, idl2) + + +if __name__ == '__main__': + unittest.main() diff --git a/scripts/py_matter_idl/matter_idl/test_xml_parser.py b/scripts/py_matter_idl/matter_idl/test_zapxml.py similarity index 100% rename from scripts/py_matter_idl/matter_idl/test_xml_parser.py rename to scripts/py_matter_idl/matter_idl/test_zapxml.py diff --git a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml index e561d1331d6eed..916fe339cc8341 100644 --- a/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml +++ b/scripts/py_matter_idl/matter_idl/tests/available_tests.yaml @@ -53,6 +53,10 @@ java-jni: java-class: inputs/several_clusters.matter: java/chip/devicecontroller/cluster/structs/SecondClusterFabricDescriptorStruct.kt: outputs/several_clusters/java/SecondClusterFabricDescriptorStruct.kt + java/chip/devicecontroller/ChipClusters.java: outputs/several_clusters/java/ChipClusters.java + java/chip/devicecontroller/ChipEventStructs.java: outputs/several_clusters/java/ChipEventStructs.java + java/chip/devicecontroller/ChipStructs.java: outputs/several_clusters/java/ChipStructs.java + java/chip/devicecontroller/ClusterInfoMapping.java: outputs/several_clusters/java/ClusterInfoMapping.java java/chip/devicecontroller/ClusterWriteMapping.java: outputs/several_clusters/java/ClusterWriteMapping.java java/chip/devicecontroller/ClusterReadMapping.java: outputs/several_clusters/java/ClusterReadMapping.java java/chip/devicecontroller/ClusterIDMapping.java: outputs/several_clusters/java/ClusterIDMapping.java diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java new file mode 100644 index 00000000000000..1523980cb4d985 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipClusters.java @@ -0,0 +1,262 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +public class ChipClusters { + + public interface DefaultClusterCallback { + void onSuccess(); + void onError(Exception error); + } + + public interface CharStringAttributeCallback { + /** Indicates a successful read for a CHAR_STRING attribute. */ + void onSuccess(String value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface OctetStringAttributeCallback { + /** Indicates a successful read for an OCTET_STRING attribute. */ + void onSuccess(byte[] value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface IntegerAttributeCallback { + void onSuccess(int value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface LongAttributeCallback { + void onSuccess(long value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface BooleanAttributeCallback { + void onSuccess(boolean value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface FloatAttributeCallback { + void onSuccess(float value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DoubleAttributeCallback { + void onSuccess(double value); + void onError(Exception error); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public static abstract class BaseChipCluster { + protected long chipClusterPtr; + + public BaseChipCluster(long devicePtr, int endpointId) { + chipClusterPtr = initWithDevice(devicePtr, endpointId); + } + + /** + * Sets the timeout, in milliseconds, after which commands sent through this cluster will fail + * with a timeout (regardless of whether or not a response has been received). If set to an + * empty optional, the default timeout will be used. + */ + public void setCommandTimeout(Optional timeoutMillis) { + setCommandTimeout(chipClusterPtr, timeoutMillis); + } + + private native void setCommandTimeout(long clusterPtr, Optional timeoutMillis); + + /** Returns the current timeout (in milliseconds) for commands sent through this cluster. */ + public Optional getCommandTimeout() { + Optional timeout = getCommandTimeout(chipClusterPtr); + return timeout == null ? Optional.empty() : timeout; + } + + private native Optional getCommandTimeout(long clusterPtr); + + public abstract long initWithDevice(long devicePtr, int endpointId); + + public native void deleteCluster(long chipClusterPtr); + + @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + + if (chipClusterPtr != 0) { + deleteCluster(chipClusterPtr); + chipClusterPtr = 0; + } + } + } + + public static class FirstCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1L; + + public FirstCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void readSomeIntegerAttribute( + IntegerAttributeCallback callback) { + readSomeIntegerAttribute(chipClusterPtr, callback); + } + + public void writeSomeIntegerAttribute(DefaultClusterCallback callback, Integer value) { + writeSomeIntegerAttribute(chipClusterPtr, callback, value, null); + } + + public void writeSomeIntegerAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeSomeIntegerAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeSomeIntegerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSomeIntegerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readSomeIntegerAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeSomeIntegerAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeSomeIntegerAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class SecondCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 2L; + + public SecondCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface FabricsAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readFabricsAttribute( + FabricsAttributeCallback callback) { + readFabricsAttribute(chipClusterPtr, callback, true); + } + + public void readFabricsAttributeWithFabricFilter( + FabricsAttributeCallback callback, boolean isFabricFiltered) { + readFabricsAttribute(chipClusterPtr, callback, isFabricFiltered); + } + + + public void subscribeFabricsAttribute( + FabricsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSomeBytesAttribute( + OctetStringAttributeCallback callback) { + readSomeBytesAttribute(chipClusterPtr, callback); + } + + public void subscribeSomeBytesAttribute( + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSomeBytesAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readFabricsAttribute(long chipClusterPtr, FabricsAttributeCallback callback, boolean isFabricFiltered); + + private native void subscribeFabricsAttribute(long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSomeBytesAttribute(long chipClusterPtr, OctetStringAttributeCallback callback); + + private native void subscribeSomeBytesAttribute(long chipClusterPtr, OctetStringAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class ThirdCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 3L; + + public ThirdCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void readSomeEnumAttribute( + IntegerAttributeCallback callback) { + readSomeEnumAttribute(chipClusterPtr, callback); + } + + public void writeSomeEnumAttribute(DefaultClusterCallback callback, Integer value) { + writeSomeEnumAttribute(chipClusterPtr, callback, value, null); + } + + public void writeSomeEnumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeSomeEnumAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeSomeEnumAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSomeEnumAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readOptionsAttribute( + IntegerAttributeCallback callback) { + readOptionsAttribute(chipClusterPtr, callback); + } + + public void writeOptionsAttribute(DefaultClusterCallback callback, Integer value) { + writeOptionsAttribute(chipClusterPtr, callback, value, null); + } + + public void writeOptionsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeOptionsAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeOptionsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeOptionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readSomeEnumAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeSomeEnumAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeSomeEnumAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readOptionsAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeOptionsAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeOptionsAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } +} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipEventStructs.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipEventStructs.java new file mode 100644 index 00000000000000..9124dfd27b2606 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipEventStructs.java @@ -0,0 +1,25 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Optional; + +public class ChipEventStructs { +} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipStructs.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipStructs.java new file mode 100644 index 00000000000000..1ff18716d4c8ba --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ChipStructs.java @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Optional; + +public class ChipStructs { +public static class SecondClusterFabricDescriptorStruct { + public byte[] rootPublicKey; + public Integer vendorID; + public Long fabricID; + public Long nodeID; + public String label; + public Integer fabricIndex; + public SecondClusterFabricDescriptorStruct( + byte[] rootPublicKey, + Integer vendorID, + Long fabricID, + Long nodeID, + String label, + Integer fabricIndex + ) { + this.rootPublicKey = rootPublicKey; + this.vendorID = vendorID; + this.fabricID = fabricID; + this.nodeID = nodeID; + this.label = label; + this.fabricIndex = fabricIndex; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("SecondClusterFabricDescriptorStruct {\n"); + output.append("\trootPublicKey: "); + output.append(Arrays.toString(rootPublicKey)); + output.append("\n"); + output.append("\tvendorID: "); + output.append(vendorID); + output.append("\n"); + output.append("\tfabricID: "); + output.append(fabricID); + output.append("\n"); + output.append("\tnodeID: "); + output.append(nodeID); + output.append("\n"); + output.append("\tlabel: "); + output.append(label); + output.append("\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +} diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterInfoMapping.java b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterInfoMapping.java new file mode 100644 index 00000000000000..16503aa7be7148 --- /dev/null +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/java/ClusterInfoMapping.java @@ -0,0 +1,291 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Nullable; +import chip.clusterinfo.ClusterInfo; +import chip.clusterinfo.InteractionInfo; +import chip.clusterinfo.CommandParameterInfo; +import chip.clusterinfo.DelegatedClusterCallback; +import chip.clusterinfo.ClusterCommandCallback; +import chip.clusterinfo.CommandResponseInfo; +import chip.devicecontroller.ChipClusters.DefaultClusterCallback; +import chip.devicecontroller.ClusterReadMapping; +import chip.devicecontroller.ClusterWriteMapping; + +public class ClusterInfoMapping { + + public static class DelegatedCharStringAttributeCallback implements ChipClusters.CharStringAttributeCallback, DelegatedClusterCallback { + /** Indicates a successful read for a CHAR_STRING attribute. */ + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "String"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOctetStringAttributeCallback implements ChipClusters.OctetStringAttributeCallback, DelegatedClusterCallback { + /** Indicates a successful read for an OCTET_STRING attribute. */ + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "byte[]"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedIntegerAttributeCallback implements ChipClusters.IntegerAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(int value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "int"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedLongAttributeCallback implements ChipClusters.LongAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "long"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedBooleanAttributeCallback implements ChipClusters.BooleanAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(boolean value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "boolean"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedFloatAttributeCallback implements ChipClusters.FloatAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(float value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "float"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedDoubleAttributeCallback implements ChipClusters.DoubleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(double value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo setupPINResponseValue = new CommandResponseInfo("value", "double"); + responseValues.put(setupPINResponseValue, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedDefaultClusterCallback implements DefaultClusterCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + // Parameters and list-adds here should be generated - refer to the template code that creates each callback interface. + @Override + public void onSuccess() { + Map responseValues = new LinkedHashMap<>(); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception e) { + callback.onFailure(e); + } + } + + public static class DelegatedSecondClusterFabricsAttributeCallback implements ChipClusters.SecondCluster.FabricsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + + public Map getClusterMap() { + Map clusterMap = initializeClusterMap(); + Map> commandMap = getCommandMap(); + combineCommand(clusterMap, commandMap); + Map> readAttributeMap = new ClusterReadMapping().getReadAttributeMap(); + combineCommand(clusterMap, readAttributeMap); + Map> writeAttributeMap = new ClusterWriteMapping().getWriteAttributeMap(); + combineCommand(clusterMap, writeAttributeMap); + return clusterMap; + } + + public Map initializeClusterMap() { + Map clusterMap = new HashMap<>(); + + ClusterInfo firstClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.FirstCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("first", firstClusterInfo); + + ClusterInfo secondClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.SecondCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("second", secondClusterInfo); + + ClusterInfo thirdClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ThirdCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("third", thirdClusterInfo); + + return clusterMap; + } + + public void combineCommand(Map destination, Map> source) { + destination.get("first").combineCommands(source.get("first")); + destination.get("second").combineCommands(source.get("second")); + destination.get("third").combineCommands(source.get("third")); + } + + @SuppressWarnings("unchecked") + public Map> getCommandMap() { + Map> commandMap = new HashMap<>(); + + Map firstClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("first", firstClusterInteractionInfoMap); + + Map secondClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("second", secondClusterInteractionInfoMap); + + Map thirdClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("third", thirdClusterInteractionInfoMap); + + return commandMap; + } +} diff --git a/scripts/py_matter_idl/matter_idl/xml_parser.py b/scripts/py_matter_idl/matter_idl/zapxml_parser.py similarity index 72% rename from scripts/py_matter_idl/matter_idl/xml_parser.py rename to scripts/py_matter_idl/matter_idl/zapxml_parser.py index 5a07490e9c3b68..1f9593cd2a74f4 100755 --- a/scripts/py_matter_idl/matter_idl/xml_parser.py +++ b/scripts/py_matter_idl/matter_idl/zapxml_parser.py @@ -16,6 +16,7 @@ import logging import os +from typing import Optional try: from matter_idl.zapxml import ParseSource, ParseXmls @@ -28,11 +29,24 @@ if __name__ == '__main__': - # This Parser is generally not intended to be run as a stand-alone binary. - # The ability to run is for debug and to print out the parsed AST. - import pprint - import click + from matter_idl.generators import GeneratorStorage + from matter_idl.generators.idl import IdlGenerator + + class InMemoryStorage(GeneratorStorage): + def __init__(self): + super().__init__() + self.content: Optional[str] = None + + def get_existing_data(self, relative_path: str): + # Force re-generation each time + return None + + def write_new_data(self, relative_path: str, content: str): + if self.content: + raise Exception( + "Unexpected extra data: single file generation expected") + self.content = content # Supported log levels, mapping string values required for argument # parsing into logging constants @@ -70,7 +84,8 @@ def main(log_level, no_print, filenames): logging.info("Parse completed") if not no_print: - print("Data:") - pprint.pp(data) + storage = InMemoryStorage() + IdlGenerator(storage=storage, idl=data).render(dry_run=False) + print(storage.content) main(auto_envvar_prefix='CHIP') diff --git a/scripts/py_matter_idl/setup.cfg b/scripts/py_matter_idl/setup.cfg index 57f93c3dd9aa82..714b42a46e614e 100644 --- a/scripts/py_matter_idl/setup.cfg +++ b/scripts/py_matter_idl/setup.cfg @@ -34,6 +34,7 @@ matter_idl = generators/cpp/application/PluginApplicationCallbacksHeader.jinja generators/cpp/tlvmeta/TLVMetaData_cpp.jinja generators/cpp/tlvmeta/TLVMetaData_h.jinja + generators/idl/MatterIdl.jinja generators/java/CHIPCallbackTypes.jinja generators/java/ChipClustersCpp.jinja generators/java/ChipClustersRead.jinja diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index 01898641a1591f..6e9ab2a2e7224a 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -922,7 +922,7 @@ def _response_values_source_validation(self, expected_response, received_respons def _response_values_validation(self, expected_response, received_response, result): check_type = PostProcessCheckType.RESPONSE_VALIDATION error_success = 'The test expectation "{name} == {value}" is true' - error_failure = 'The test expectation "{name} == {value}" is false' + error_failure = 'The test expectation "{name} ({actual}) == {value}" is false' error_name_does_not_exist = 'The test expects a value named "{name}" but it does not exists in the response."' error_value_does_not_exist = 'The test expects a value but it does not exists in the response."' @@ -953,7 +953,7 @@ def _response_values_validation(self, expected_response, received_response, resu name=expected_name, value=expected_value)) else: result.error(check_type, error_failure.format( - name=expected_name, value=expected_value)) + name=expected_name, actual=received_value, value=expected_value)) def _response_value_validation(self, expected_value, received_value): if isinstance(expected_value, list): diff --git a/scripts/setup/bootstrap.sh b/scripts/setup/bootstrap.sh index 64866fc2e3860b..57864b3b410e5e 100644 --- a/scripts/setup/bootstrap.sh +++ b/scripts/setup/bootstrap.sh @@ -116,8 +116,12 @@ _bootstrap_or_activate() { export PW_DOCTOR_SKIP_CIPD_CHECKS=1 export PATH # https://bugs.chromium.org/p/pigweed/issues/detail?id=281 + local _PIGWEED_CIPD_JSON="$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json" + mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT" + local _GENERATED_PIGWEED_CIPD_JSON="$_PW_ACTUAL_ENVIRONMENT_ROOT/pigweed.json" + scripts/setup/gen_pigweed_cipd_json.py -i $_PIGWEED_CIPD_JSON -o $_GENERATED_PIGWEED_CIPD_JSON + if test -n "$GITHUB_ACTION"; then - mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT" tee <"${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip.conf" [global] cache-dir = ${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip-cache @@ -131,7 +135,8 @@ EOF pw_bootstrap --shell-file "$_SETUP_SH" \ --install-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT" \ --config-file "$_CHIP_ROOT/$_CONFIG_FILE" \ - --virtualenv-gn-out-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT/gn_out" + --virtualenv-gn-out-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT/gn_out" \ + --additional-cipd-file "$_GENERATED_PIGWEED_CIPD_JSON" pw_finalize bootstrap "$_SETUP_SH" _ACTION_TAKEN="bootstrap" else diff --git a/scripts/setup/constraints.txt b/scripts/setup/constraints.txt index a80c8a297d9fa8..b0e9aed4ae60e7 100644 --- a/scripts/setup/constraints.txt +++ b/scripts/setup/constraints.txt @@ -2,32 +2,24 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --allow-unsafe --output-file=constraints.txt --resolver=backtracking --strip-extras requirements.all.txt +# pip-compile --allow-unsafe --output-file=constraints.txt --strip-extras requirements.all.txt # anytree==2.8.0 # via -r requirements.memory.txt appdirs==1.4.4 - # via - # -r requirements.all.txt - # mbed-os-tools + # via -r requirements.all.txt appnope==0.1.3 # via -r requirements.all.txt asttokens==2.2.1 # via stack-data attrs==22.2.0 - # via - # jsonschema - # pytest + # via jsonschema backcall==0.2.0 # via ipython -beautifulsoup4==4.11.2 - # via mbed-os-tools -bflb-crypto-plus==1.0 - # via bflb-iot-tool -bflb-iot-tool==1.8.3 - # via -r requirements.bouffalolab.txt bitstring==3.1.9 - # via -r requirements.esp32.txt + # via + # -r requirements.esp32.txt + # esptool build==0.8.0 # via # -r requirements.all.txt @@ -37,9 +29,7 @@ cachecontrol==0.12.11 cbor==1.0.0 # via -r requirements.zephyr.txt cbor2==5.4.6 - # via - # -r requirements.zephyr.txt - # imgtool + # via -r requirements.zephyr.txt certifi==2022.12.7 # via requests cffi==1.15.1 @@ -51,33 +41,33 @@ click==8.1.3 # -r requirements.build.txt # -r requirements.esp32.txt # idf-component-manager - # imgtool - # mbed-tools # pip-tools colorama==0.4.6 # via # -r requirements.all.txt # idf-component-manager - # mbed-os-tools # west coloredlogs==15.0.1 # via -r requirements.all.txt construct==2.10.54 - # via -r requirements.esp32.txt + # via + # -r requirements.esp32.txt + # esp-coredump contextlib2==21.6.0 # via # idf-component-manager # schema cryptography==39.0.2 # via + # -c constraints.esp32.txt # -r requirements.all.txt - # imgtool + # esptool cxxfilt==0.3.0 # via -r requirements.memory.txt decorator==5.1.1 # via ipython diskcache==5.4.0 - # via -r requirements.yaml_tests.txt + # via -r requirements.all.txt distlib==0.3.6 # via virtualenv docopt==0.6.2 @@ -85,86 +75,55 @@ docopt==0.6.2 ecdsa==0.18.0 # via # -r requirements.esp32.txt - # -r requirements.ti.txt - # bflb-iot-tool + # esptool +esp-coredump==1.7.0 + # via esp-idf-monitor +esp-idf-kconfig==1.2.0 + # via -r requirements.esp32.txt +esp-idf-monitor==1.1.1 + # via -r requirements.esp32.txt +esptool==4.6.2 + # via esp-coredump executing==1.2.0 # via stack-data fastcore==1.5.28 # via ghapi -fasteners==0.18 - # via mbed-os-tools filelock==3.9.0 # via virtualenv future==0.18.3 # via # -r requirements.esp32.txt - # -r requirements.telink.txt # idf-component-manager - # mbed-os-tools - # pylink-square ghapi==1.0.3 # via -r requirements.memory.txt -gitdb==4.0.10 - # via gitpython -gitpython==3.1.31 ; platform_machine != "aarch64" and sys_platform == "linux" - # via - # -r requirements.mbed.txt - # mbed-tools humanfriendly==10.0 # via coloredlogs idf-component-manager==1.2.2 # via -r requirements.esp32.txt idna==3.4 # via requests -imgtool==1.9.0 - # via -r requirements.openiotsdk.txt -iniconfig==2.0.0 - # via pytest intelhex==2.3.0 - # via - # -r requirements.zephyr.txt - # imgtool - # mbed-os-tools + # via -r requirements.zephyr.txt ipython==8.11.0 # via -r requirements.all.txt -itsdangerous==2.0.1 - # via -r requirements.esp32.txt jedi==0.18.2 # via ipython jinja2==3.0.3 - # via - # -r requirements.build.txt - # mbed-tools + # via -r requirements.build.txt jsonschema==4.17.3 # via -r requirements.zephyr.txt -junit-xml==1.9 - # via mbed-os-tools kconfiglib==13.7.1 - # via -r requirements.esp32.txt + # via esp-idf-kconfig lark==1.1.5 - # via -r requirements.build.txt -leb128==1.0.5 - # via -r requirements.infineon.txt -lockfile==0.12.2 # via - # cachecontrol - # mbed-os-tools -mako==1.2.4 - # via pdoc3 -markdown==3.4.1 - # via pdoc3 + # -r requirements.all.txt + # -r requirements.build.txt +lockfile==0.12.2 + # via cachecontrol markupsafe==2.1.2 - # via - # jinja2 - # mako + # via jinja2 matplotlib-inline==0.1.6 # via ipython -mbed-ls==1.8.11 ; platform_machine != "aarch64" and sys_platform == "linux" - # via -r requirements.mbed.txt -mbed-os-tools==1.8.15 - # via mbed-ls -mbed-tools==7.59.0 ; platform_machine != "aarch64" and sys_platform == "linux" - # via -r requirements.mbed.txt mobly==1.12.1 # via -r requirements.all.txt msgpack==1.0.4 @@ -173,7 +132,7 @@ mypy==0.971 # via -r requirements.all.txt mypy-extensions==1.0.0 # via mypy -mypy-protobuf==3.2.0 +mypy-protobuf==3.5.0 # via -r requirements.all.txt numpy==1.24.2 # via pandas @@ -183,14 +142,11 @@ packaging==23.0 # fastcore # ghapi # idf-component-manager - # pytest # west pandas==1.5.3 ; platform_machine != "aarch64" and platform_machine != "arm64" # via -r requirements.memory.txt parso==0.8.3 # via jedi -pdoc3==0.10.0 ; platform_machine != "aarch64" and sys_platform == "linux" - # via -r requirements.mbed.txt pep517==0.13.0 # via build pexpect==4.8.0 @@ -203,106 +159,70 @@ pip-tools==7.0.0 # via -r requirements.all.txt platformdirs==3.0.0 # via virtualenv -pluggy==1.0.0 - # via pytest -portalocker==2.0.0 - # via bflb-iot-tool portpicker==1.5.2 # via # -r requirements.all.txt # mobly -prettytable==2.5.0 - # via - # mbed-ls - # mbed-os-tools prompt-toolkit==3.0.38 # via ipython -protobuf==3.20.1 +protobuf==4.24.4 # via # -r requirements.all.txt # mypy-protobuf psutil==5.9.4 - # via - # mbed-tools - # portpicker - # pylink-square + # via portpicker ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -py==1.11.0 - # via pytest -pycklink==0.1.1 - # via bflb-iot-tool pycparser==2.21 # via cffi -pycryptodome==3.9.8 +pyelftools==0.30 # via - # bflb-crypto-plus - # bflb-iot-tool + # -c constraints.esp32.txt + # esp-idf-monitor pygdbmi==0.9.0.2 - # via -r requirements.esp32.txt + # via + # -r requirements.esp32.txt + # esp-coredump pygments==2.14.0 # via ipython pykwalify==1.8.0 # via west -pylink-square==0.5.0 - # via bflb-iot-tool pyparsing==3.0.9 # via -r requirements.esp32.txt -pypng==0.0.21 - # via -r requirements.telink.txt -pyqrcode==1.2.1 - # via -r requirements.telink.txt pyrsistent==0.19.3 # via jsonschema pyserial==3.5 # via # -c constraints.esp32.txt - # bflb-iot-tool - # mbed-os-tools - # mbed-tools -pytest==6.2.5 ; sys_platform == "linux" - # via - # -r requirements.mbed.txt - # pytest-json-report - # pytest-metadata -pytest-json-report==1.5.0 - # via -r requirements.openiotsdk.txt -pytest-metadata==2.0.4 - # via pytest-json-report + # esp-idf-monitor + # esptool python-dateutil==2.8.2 # via # pandas # pykwalify -python-dotenv==1.0.0 ; platform_machine != "aarch64" and sys_platform == "linux" - # via - # -r requirements.mbed.txt - # mbed-tools python-engineio==3.14.2 # via python-socketio python-socketio==4.6.1 # via -r requirements.esp32.txt pytz==2022.7.1 # via pandas -pyudev==0.24.0 ; platform_machine != "aarch64" and sys_platform == "linux" - # via - # -r requirements.mbed.txt - # mbed-tools pyyaml==6.0 # via + # esptool # idf-component-manager # mobly # west reedsolo==1.5.4 - # via -r requirements.esp32.txt + # via + # -r requirements.esp32.txt + # esptool requests==2.28.2 # via # -r requirements.cirque.txt # cachecontrol # idf-component-manager - # mbed-os-tools - # mbed-tools # requests-file # requests-toolbelt requests-file==1.5.1 @@ -319,46 +239,30 @@ six==1.16.0 # asttokens # ecdsa # idf-component-manager - # junit-xml - # mbed-os-tools - # pylink-square # python-dateutil # python-engineio # python-socketio # requests-file -smmap==5.0.0 - # via gitdb -soupsieve==2.4 - # via beautifulsoup4 stack-data==0.6.2 # via ipython stringcase==1.2.0 # via -r requirements.build.txt tabulate==0.9.0 - # via - # -r requirements.memory.txt - # mbed-tools -toml==0.10.2 - # via pytest + # via -r requirements.memory.txt tornado==6.2 # via -r requirements.all.txt tqdm==4.64.1 - # via - # idf-component-manager - # mbed-tools + # via idf-component-manager traitlets==5.9.0 # via # ipython # matplotlib-inline -types-protobuf==3.19.22 +types-protobuf==4.24.0.2 # via # -r requirements.all.txt # mypy-protobuf -typing-extensions==4.5.0 ; platform_machine != "aarch64" and sys_platform == "linux" - # via - # -r requirements.mbed.txt - # mbed-tools - # mypy +typing-extensions==4.5.0 + # via mypy urllib3==1.26.14 # via requests virtualenv==20.20.0 @@ -366,11 +270,9 @@ virtualenv==20.20.0 watchdog==2.3.1 # via -r requirements.all.txt wcwidth==0.2.6 - # via - # prettytable - # prompt-toolkit + # via prompt-toolkit websockets==10.4 - # via -r requirements.yaml_tests.txt + # via -r requirements.all.txt west==1.0.0 # via -r requirements.zephyr.txt wheel==0.38.4 ; sys_platform == "linux" diff --git a/scripts/setup/environment.json b/scripts/setup/environment.json index 23b4bb20a019f8..fc9ace2b99b11c 100644 --- a/scripts/setup/environment.json +++ b/scripts/setup/environment.json @@ -1,7 +1,6 @@ { "cipd_package_files": [ "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/arm.json", - "scripts/setup/pigweed.json", "scripts/setup/python.json", "scripts/setup/zap.json" ], diff --git a/scripts/setup/gen_pigweed_cipd_json.py b/scripts/setup/gen_pigweed_cipd_json.py new file mode 100755 index 00000000000000..c5cf6d95cbcba5 --- /dev/null +++ b/scripts/setup/gen_pigweed_cipd_json.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import json + +_LIST_OF_PACKAGES_TO_EXCLUDE = ['fuchsia/third_party/rust/'] + + +def include_package(package: dict) -> bool: + if 'path' in package: + path = package['path'] + exclusion_match = any( + path.startswith(package_to_exclude) + for package_to_exclude in _LIST_OF_PACKAGES_TO_EXCLUDE + ) + if exclusion_match: + return False + return True + + +def generate_new_cipd_package_json(input, output): + with open(input) as ins: + packages = json.load(ins) + file_packages = packages.get('packages') + new_file_packages = [x for x in file_packages if include_package(x)] + + new_packages = {'packages': new_file_packages} + with open(output, 'w') as f: + json.dump(new_packages, f, indent=2) + + +def main(): + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + ) + parser.add_argument( + '--input', '-i', required=True + ) + parser.add_argument( + '--output', '-o', required=True + ) + generate_new_cipd_package_json(**vars(parser.parse_args())) + + +if __name__ == '__main__': + main() diff --git a/scripts/setup/pigweed.json b/scripts/setup/pigweed.json deleted file mode 100644 index 3147b578705073..00000000000000 --- a/scripts/setup/pigweed.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "packages": [ - { - "path": "gn/gn/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64", - "mac-arm64", - "windows-amd64" - ], - "tags": [ - "git_revision:991530ce394efb58fcd848195469022fa17ae126" - ], - "version_file": ".versions/gn.cipd_version" - }, - { - "path": "infra/3pp/tools/ninja/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64", - "mac-arm64", - "windows-amd64" - ], - "tags": [ - "version:2@1.11.1.chromium.7" - ] - }, - { - "path": "fuchsia/third_party/bloaty/${platform}", - "platforms": [ - "linux-amd64", - "mac-amd64" - ], - "tags": [ - "git_revision:c057ba4f43db0506d4ba8c096925b054b02a8bd3" - ], - "version_file": ".versions/bloaty.cipd_version" - }, - { - "path": "infra/3pp/tools/protoc/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64", - "windows-amd64" - ], - "tags": [ - "version:2@3.17.3" - ] - }, - { - "_comment": "Always get the amd64 version on Mac until there's an arm64 version", - "path": "infra/3pp/tools/protoc/mac-amd64", - "platforms": [ - "mac-arm64" - ], - "tags": [ - "version:2@3.17.3" - ] - }, - { - "path": "fuchsia/third_party/clang/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64", - "mac-arm64", - "windows-amd64" - ], - "tags": [ - "git_revision:576b184d6e3b633f51b908b61ebd281d2ecbf66f" - ], - "version_file": ".versions/clang.cipd_version" - }, - { - "path": "infra/3pp/tools/openocd/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64", - "mac-arm64" - ], - "tags": [ - "version:2@0.11.0-3" - ] - }, - { - "path": "pigweed/third_party/mingw64-x86_64-win32-seh/${platform}", - "platforms": [ - "windows-amd64" - ], - "tags": [ - "version:10.2.0-11" - ] - }, - { - "path": "fuchsia/third_party/qemu/${platform}", - "platforms": [ - "linux-amd64", - "linux-arm64", - "mac-amd64" - ], - "tags": [ - "git_revision:a342ce9dfeed8088c426e5d51d4a7e47f3764b84" - ], - "version_file": ".versions/qemu.cipd_version" - }, - { - "path": "fuchsia/third_party/sysroot/linux", - "platforms": [ - "linux-amd64", - "linux-arm64" - ], - "subdir": "clang_sysroot", - "tags": [ - "git_revision:d342388843734b6c5c50fb7e18cd3a76476b93aa" - ] - } - ] -} diff --git a/scripts/setup/requirements.all.txt b/scripts/setup/requirements.all.txt index 2cccfdbf84db03..3266eaf8504572 100644 --- a/scripts/setup/requirements.all.txt +++ b/scripts/setup/requirements.all.txt @@ -39,9 +39,9 @@ coloredlogs watchdog build==0.8.0 mypy==0.971 -mypy-protobuf==3.2.0 -protobuf==3.20.1 -types-protobuf==3.19.22 +mypy-protobuf==3.5.0 +protobuf==4.24.4 +types-protobuf==4.24.0.2 cryptography diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index f3869514ca7356..b9e8e18016cd31 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.10.14-nightly.1"] + "tags": ["version:2@v2023.10.24-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.10.14-nightly.1"] + "tags": ["version:2@v2023.10.24-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 443586d7cdbe6c..c26dc3f85a55d8 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.10.14-nightly +v2023.10.24-nightly diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py new file mode 100755 index 00000000000000..1b3a767aa1c242 --- /dev/null +++ b/scripts/spec_xml/generate_spec_xml.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import glob +import os +import subprocess + +import click + +DEFAULT_CHIP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) +DEFAULT_OUTPUT_DIR = os.path.abspath(os.path.join(DEFAULT_CHIP_ROOT, 'data_model')) + + +@click.command() +@click.option( + '--scraper', + required=True, + type=str, + help='Path to the location of the scraper tool') +@click.option( + '--spec-root', + required=True, + type=str, + help='Path to the spec root') +@click.option( + '--output-dir', + default=DEFAULT_OUTPUT_DIR, + help='Path to output xml files') +@click.option( + '--dry-run', + default=False, + is_flag=True, + help='Flag for dry run') +def main(scraper, spec_root, output_dir, dry_run): + # TODO: Add scrapers for device types + + src_dir = os.path.abspath(os.path.join(spec_root, 'src')) + sdm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'service_device_management')) + app_clusters_dir = os.path.abspath(os.path.join(src_dir, 'app_clusters')) + dm_clusters_dir = os.path.abspath(os.path.join(src_dir, 'data_model')) + media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) + clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) + dm_clusters_list = ['ACL-Cluster.adoc', 'Binding-Cluster.adoc', 'bridge-clusters.adoc', + 'Descriptor-Cluster.adoc', 'Group-Key-Management-Cluster.adoc', 'Label-Cluster.adoc'] + sdm_exclude_list = ['AdminAssistedCommissioningFlows.adoc', 'BulkDataExchange.adoc', 'CommissioningFlows.adoc', + 'DeviceCommissioningFlows.adoc', 'DistributedComplianceLedger.adoc', 'OTAFileFormat.adoc'] + app_exclude_list = ['appliances.adoc', 'closures.adoc', 'general.adoc', + 'hvac.adoc', 'lighting.adoc', 'meas_and_sense.adoc', 'robots.adoc'] + media_exclude_list = ['media.adoc', 'VideoPlayerArchitecture.adoc'] + + if not os.path.exists(clusters_output_dir): + os.makedirs(clusters_output_dir) + + def scrape_cluster(filename: str) -> None: + xml = os.path.basename(filename).replace('.adoc', '.xml') + xml_path = os.path.abspath(os.path.join(clusters_output_dir, xml)) + cmd = [scraper, 'cluster', filename, xml_path, '-nd'] + if dry_run: + print(cmd) + else: + subprocess.run(cmd) + + def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: + for filename in glob.glob(f'{dir}/*.adoc'): + if os.path.basename(filename) in exclude_list: + continue + scrape_cluster(filename) + + scrape_all_clusters(sdm_clusters_dir, sdm_exclude_list) + scrape_all_clusters(app_clusters_dir, app_exclude_list) + scrape_all_clusters(media_clusters_dir, media_exclude_list) + for f in dm_clusters_list: + filename = f'{dm_clusters_dir}/{f}' + scrape_cluster(filename) + + # Put the current spec sha into the cluster dir + sha_file = os.path.abspath(os.path.join(output_dir, 'spec_sha')) + out = subprocess.run(['git', 'rev-parse', 'HEAD'], capture_output=True, encoding="utf8", cwd=spec_root) + sha = out.stdout + with open(sha_file, 'wt', encoding='utf8') as output: + output.write(sha) + + +if __name__ == '__main__': + main() diff --git a/scripts/tagging/tag_new_release.sh b/scripts/tagging/tag_new_release.sh new file mode 100755 index 00000000000000..0a1f3302808791 --- /dev/null +++ b/scripts/tagging/tag_new_release.sh @@ -0,0 +1,58 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#!/bin/bash + +CURRENT_SPEC_VERSION=$(cat SPECIFICATION_VERSION) + +# Pulls the most recent release from gihub, matching the spec version on the current tree +CURRENT_RELEASE=$(gh release list --exclude-pre-releases | grep -Fi "$CURRENT_SPEC_VERSION" | awk '{print $1}' | head -n1) + +if [ -z "$CURRENT_RELEASE" ]; then + # If there are no releases, this is our first one for this Spec version + SDK_RELEASE_REVISIONS=0 + echo "No revision found for current release" +else + # Otherwise pull the SDK revision (4th item) from the release + SDK_RELEASE_REVISIONS="$(echo "$CURRENT_RELEASE" | cut -d'.' -f4)" +fi + +if [ ! -z "$CURRENT_RELEASE" ]; then + # If there is current release, construct a string like 1.2.0.0 based o the current one + CURRENT_RELEASE="v$CURRENT_SPEC_VERSION.$SDK_RELEASE_REVISIONS" + # Then revise the SDK release to be +1 + SDK_RELEASE_REVISIONS=$(($SDK_RELEASE_REVISIONS + 1)) +fi + +# Construct a final tag, eg: 1.2.0.5 (MAJOR.MINOR.PATCH.SDK_REVISION) +NEW_RELEASE_TAG="v$CURRENT_SPEC_VERSION.$SDK_RELEASE_REVISIONS" + +ADDITIONAL_ARGS="" + +# Look for any prerelease information in the spec version (eg: 1.3.0-sve), and target the prerelease channel +case "$NEW_RELEASE_TAG" in + *alpha* | *beta* | *prerelease* | *testevent* | *te* | *sve*) + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --prerelease" + ;; +esac + +echo "Current release: $CURRENT_RELEASE" +echo "SDK release revisions: $SDK_RELEASE_REVISIONS" +echo "New release: $NEW_RELEASE_TAG" +echo "Additional arguments: $ADDITIONAL_ARGS" + +echo executing: gh release create "$NEW_RELEASE_TAG" --notes-start-tag "$CURRENT_RELEASE" "$@" "$ADDITIONAL_ARGS" +gh release create $NEW_RELEASE_TAG "--notes-start-tag" $CURRENT_RELEASE $@ $ADDITIONAL_ARGS diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index fe430bda1dbece..12d89a5da8d510 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -4631,7 +4631,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5473,6 +5473,7 @@ "define": "FAULT_INJECTION_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "internal", "commands": [ { "name": "FailAtFault", @@ -5978,6 +5979,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -6175,7 +6177,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "16", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6191,7 +6193,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "8", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6271,7 +6273,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10119,6 +10121,7 @@ "define": "FAN_CONTROL_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "attributes": [ { "name": "FanMode", @@ -12885,7 +12888,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13261,6 +13264,7 @@ "define": "UNIT_TESTING_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "internal", "commands": [ { "name": "Test", @@ -15222,6 +15226,7 @@ "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddScene", @@ -15419,7 +15424,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "16", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15435,7 +15440,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "8", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15515,7 +15520,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -16259,14 +16264,14 @@ "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" }, "deviceTypes": [ { - "code": 61442, + "code": 4293984258, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" @@ -16276,10 +16281,10 @@ 1 ], "deviceIdentifiers": [ - 61442 + 4293984258 ], "deviceTypeName": "MA-secondary-network-commissioning", - "deviceTypeCode": 61442, + "deviceTypeCode": 4293984258, "deviceTypeProfileId": 259, "clusters": [ { @@ -16354,6 +16359,70 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -16598,6 +16667,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "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": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -16664,5 +16797,6 @@ "endpointId": 65534, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index e4f4e057b87896..7fbcb784bfd527 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -3678,7 +3678,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 0, @@ -5742,5 +5742,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h index 8601882bb35715..0b42feede68eab 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CHIPClusters.h @@ -32,8 +32,7 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { public: OtaSoftwareUpdateProviderCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) + EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) {} ~OtaSoftwareUpdateProviderCluster() {} }; diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h index 56437352d10126..8b7bd0f6a71263 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h @@ -88,6 +88,7 @@ /* Cluster: Color Control, Attribute: ColorPointBY, Privilege: view */ \ /* Cluster: Color Control, Attribute: ColorPointBIntensity, Privilege: view */ \ /* Cluster: Color Control, Attribute: StartUpColorTemperatureMireds, Privilege: view */ \ + 0x0000050D, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } // Parallel array data (cluster, *attribute*, privilege) for read attribute @@ -151,6 +152,7 @@ /* Cluster: Color Control, Attribute: ColorPointBY, Privilege: view */ \ /* Cluster: Color Control, Attribute: ColorPointBIntensity, Privilege: view */ \ /* Cluster: Color Control, Attribute: StartUpColorTemperatureMireds, Privilege: view */ \ + 0x00000007, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } // Parallel array data (cluster, attribute, *privilege*) for read attribute @@ -214,6 +216,7 @@ /* Cluster: Color Control, Attribute: ColorPointBY, Privilege: view */ \ /* Cluster: Color Control, Attribute: ColorPointBIntensity, Privilege: view */ \ /* Cluster: Color Control, Attribute: StartUpColorTemperatureMireds, Privilege: view */ \ + kMatterAccessPrivilegeAdminister, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } //////////////////////////////////////////////////////////////////////////////// @@ -222,11 +225,13 @@ #define GENERATED_ACCESS_WRITE_ATTRIBUTE__CLUSTER { \ 0x00000006, /* Cluster: On/Off, Attribute: StartUpOnOff, Privilege: manage */ \ 0x00000008, /* Cluster: Level Control, Attribute: StartUpCurrentLevel, Privilege: manage */ \ + 0x0000001E, /* Cluster: Binding, Attribute: Binding, Privilege: manage */ \ 0x0000001F, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ 0x0000001F, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ 0x00000028, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ 0x00000028, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ 0x00000028, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + 0x0000002B, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ 0x00000030, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ 0x00000031, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ 0x0000003F, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -276,11 +281,13 @@ #define GENERATED_ACCESS_WRITE_ATTRIBUTE__ATTRIBUTE { \ 0x00004003, /* Cluster: On/Off, Attribute: StartUpOnOff, Privilege: manage */ \ 0x00004000, /* Cluster: Level Control, Attribute: StartUpCurrentLevel, Privilege: manage */ \ + 0x00000000, /* Cluster: Binding, Attribute: Binding, Privilege: manage */ \ 0x00000000, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ 0x00000001, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ 0x00000005, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ 0x00000006, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ 0x00000010, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + 0x00000000, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ 0x00000000, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ 0x00000004, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ 0x00000000, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -330,11 +337,13 @@ #define GENERATED_ACCESS_WRITE_ATTRIBUTE__PRIVILEGE { \ kMatterAccessPrivilegeManage, /* Cluster: On/Off, Attribute: StartUpOnOff, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Level Control, Attribute: StartUpCurrentLevel, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Binding, Attribute: Binding, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Access Control, Attribute: ACL, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Access Control, Attribute: Extension, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -404,6 +413,8 @@ 0x00000031, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ 0x00000031, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ 0x00000033, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + 0x00000034, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + 0x00000037, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ @@ -430,6 +441,7 @@ 0x00000101, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \ 0x00000101, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \ 0x00000101, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \ + 0x00000507, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ 0xFFF1FC06, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ 0xFFF1FC06, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ } @@ -456,6 +468,8 @@ 0x00000006, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ 0x00000008, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ 0x00000000, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + 0x00000000, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + 0x00000000, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ 0x00000000, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ 0x00000001, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ 0x00000002, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ @@ -482,6 +496,7 @@ 0x00000022, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \ 0x00000024, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \ 0x00000026, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \ + 0x00000003, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ 0x00000000, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ 0x00000001, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ } @@ -508,6 +523,8 @@ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ @@ -534,6 +551,7 @@ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: SetCredential, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: GetCredentialStatus, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Door Lock, Command: ClearCredential, Privilege: administer */ \ + kMatterAccessPrivilegeManage, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailAtFault, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Fault Injection, Command: FailRandomlyAtFault, Privilege: manage */ \ } diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 282deca1883650..16e6c92fe83576 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -691,7 +691,7 @@ { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* WindowStatus */ \ { ZAP_EMPTY_DEFAULT(), 0x00000001, 1, ZAP_TYPE(FABRIC_IDX), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* AdminFabricIndex */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(INT16U), \ + { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(VENDOR_ID), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* AdminVendorId */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -759,9 +759,9 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000002, 2, ZAP_TYPE(GROUP_ID), 0 }, /* CurrentGroup */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000003, 1, ZAP_TYPE(BOOLEAN), 0 }, /* SceneValid */ \ { ZAP_EMPTY_DEFAULT(), 0x00000004, 1, ZAP_TYPE(BITMAP8), 0 }, /* NameSupport */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* SceneTableSize */ \ + { ZAP_SIMPLE_DEFAULT(16), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* SceneTableSize */ \ { ZAP_EMPTY_DEFAULT(), 0x00000007, 1, ZAP_TYPE(INT8U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* RemainingCapacity */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(7), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(5), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ @@ -1143,12 +1143,15 @@ { ZAP_SIMPLE_DEFAULT(3), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000000, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MeasuredValue */ \ - { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000001, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MinMeasuredValue */ \ - { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000002, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), 0 }, /* Tolerance */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000000, 2, ZAP_TYPE(TEMPERATURE), \ + ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MeasuredValue */ \ + { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000001, 2, ZAP_TYPE(TEMPERATURE), \ + ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MinMeasuredValue */ \ + { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000002, 2, ZAP_TYPE(TEMPERATURE), \ + ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* Tolerance */ \ + { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000000, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MeasuredValue */ \ @@ -1239,12 +1242,12 @@ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000000, 33, ZAP_TYPE(CHAR_STRING), 0 }, /* VendorName */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000001, 2, ZAP_TYPE(VENDOR_ID), 0 }, /* VendorID */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000002, 33, ZAP_TYPE(CHAR_STRING), 0 }, /* ApplicationName */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), 0 }, /* ProductID */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000005, 1, ZAP_TYPE(ENUM8), 0 }, /* Status */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000006, 33, ZAP_TYPE(CHAR_STRING), 0 }, /* ApplicationVersion */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000000, 33, ZAP_TYPE(CHAR_STRING), 0 }, /* VendorName */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000001, 2, ZAP_TYPE(VENDOR_ID), 0 }, /* VendorID */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000002, 258, ZAP_TYPE(LONG_CHAR_STRING), 0 }, /* ApplicationName */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), 0 }, /* ProductID */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000005, 1, ZAP_TYPE(ENUM8), 0 }, /* Status */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000006, 33, ZAP_TYPE(CHAR_STRING), 0 }, /* ApplicationVersion */ \ { ZAP_EMPTY_DEFAULT(), 0x00000007, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* AllowedVendorList */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1425,9 +1428,9 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000002, 2, ZAP_TYPE(GROUP_ID), 0 }, /* CurrentGroup */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000003, 1, ZAP_TYPE(BOOLEAN), 0 }, /* SceneValid */ \ { ZAP_EMPTY_DEFAULT(), 0x00000004, 1, ZAP_TYPE(BITMAP8), 0 }, /* NameSupport */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* SceneTableSize */ \ + { ZAP_SIMPLE_DEFAULT(16), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* SceneTableSize */ \ { ZAP_EMPTY_DEFAULT(), 0x00000007, 1, ZAP_TYPE(INT8U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* RemainingCapacity */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(7), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(5), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: On/Off (server) */ \ @@ -2851,7 +2854,7 @@ .clusterId = 0x0000050D, \ .attributes = ZAP_ATTRIBUTE_INDEX(573), \ .attributeCount = 9, \ - .clusterSize = 110, \ + .clusterSize = 335, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = nullptr, \ @@ -3024,7 +3027,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 27, 345 }, { ZAP_CLUSTER_INDEX(27), 44, 3492 }, { ZAP_CLUSTER_INDEX(71), 7, 127 }, \ + { ZAP_CLUSTER_INDEX(0), 27, 345 }, { ZAP_CLUSTER_INDEX(27), 44, 3717 }, { ZAP_CLUSTER_INDEX(71), 7, 127 }, \ { ZAP_CLUSTER_INDEX(78), 2, 4 }, \ } @@ -3037,7 +3040,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3968) +#define ATTRIBUTE_MAX_SIZE (4193) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) @@ -3058,9 +3061,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, // Array of device types #define FIXED_DEVICE_TYPES \ { \ - { 0x0011, 1 }, { 0x0016, 1 }, { 0x0100, 1 }, { 0x0011, 1 }, { 0x0100, 1 }, { 0x0011, 1 }, \ + { 0x00000011, 1 }, { 0x00000016, 1 }, { 0x00000100, 1 }, { 0x00000011, 1 }, { 0x00000100, 1 }, { 0x00000011, 1 }, \ { \ - 0xF002, 1 \ + 0xFFF10002, 1 \ } \ } diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h index bf4dbc94ede3f7..fc0a4d3df39f84 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h @@ -102,17 +102,16 @@ #define EMBER_AF_PLUGIN_SCENES_SERVER #define EMBER_AF_PLUGIN_SCENES // User options for server plugin Scenes -// Cluster spec 1.4.8.2 -#ifdef CHIP_CONFIG_MAX_SCENES_PER_FABRIC -#define MATTER_SCENES_TABLE_SIZE CHIP_CONFIG_MAX_SCENES_PER_FABRIC -#else +// Cluster spec 1.4.8.7 #define MATTER_SCENES_TABLE_SIZE 16 -#endif - // Scenes FeatureMap Attribute Toggle Scenes Name feature // App cluster specs 1.4.4 #define MATTER_CLUSTER_SCENE_NAME_SUPPORT_MASK 0x0001 -#define MATTER_CLUSTER_SCENE_NAME_SUPPORT (0x0000 & MATTER_CLUSTER_SCENE_NAME_SUPPORT_MASK) +#define MATTER_CLUSTER_SCENE_NAME_SUPPORT (0x0007 & MATTER_CLUSTER_SCENE_NAME_SUPPORT_MASK) +// Scenes FeatureMap Table Size feature used for the MATTER_SCENES_TABLE_SIZE define +// App cluster specs 1.4.4.2 +#define MATTER_CLUSTER_TABLE_SIZE_SUPPORT_MASK 0x0001 +#define MATTER_CLUSTER_TABLE_SIZE_SUPPORT (0x0007 & MATTER_CLUSTER_TABLE_SIZE_SUPPORT_MASK) // Use this macro to check if the server side of the On/Off cluster is included #define ZCL_USING_ON_OFF_CLUSTER_SERVER diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h index 8601882bb35715..0b42feede68eab 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/CHIPClusters.h @@ -32,8 +32,7 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase { public: OtaSoftwareUpdateProviderCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, - EndpointId endpoint) : - ClusterBase(exchangeManager, session, endpoint) + EndpointId endpoint) : ClusterBase(exchangeManager, session, endpoint) {} ~OtaSoftwareUpdateProviderCluster() {} }; diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h index b9946f3ca9162d..69e302c592fffe 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h @@ -113,6 +113,7 @@ 0x00000028, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ 0x00000028, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ 0x00000028, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + 0x0000002B, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ 0x00000030, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ 0x00000031, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ 0x0000003F, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -129,6 +130,7 @@ 0x00000005, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ 0x00000006, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ 0x00000010, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + 0x00000000, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ 0x00000000, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ 0x00000004, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ 0x00000000, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -145,6 +147,7 @@ kMatterAccessPrivilegeManage, /* Cluster: Basic Information, Attribute: NodeLabel, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Basic Information, Attribute: Location, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: Basic Information, Attribute: LocalConfigDisabled, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Localization Configuration, Attribute: ActiveLocale, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: General Commissioning, Attribute: Breadcrumb, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Attribute: InterfaceEnabled, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: Group Key Management, Attribute: GroupKeyMap, Privilege: manage */ \ @@ -172,6 +175,8 @@ 0x00000031, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ 0x00000031, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ 0x00000033, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + 0x00000034, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + 0x00000037, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ 0x0000003C, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ @@ -207,6 +212,8 @@ 0x00000006, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ 0x00000008, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ 0x00000000, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + 0x00000000, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + 0x00000000, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ 0x00000000, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ 0x00000001, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ 0x00000002, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ @@ -242,6 +249,8 @@ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Command: ConnectNetwork, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Network Commissioning, Command: ReorderNetwork, Privilege: administer */ \ kMatterAccessPrivilegeManage, /* Cluster: General Diagnostics, Command: TestEventTrigger, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Software Diagnostics, Command: ResetWatermarks, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Ethernet Network Diagnostics, Command: ResetCounts, Privilege: manage */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: OpenCommissioningWindow, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: OpenBasicCommissioningWindow, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Administrator Commissioning, Command: RevokeCommissioning, Privilege: administer */ \ diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index 7176d34b83b1a7..b321c516ab9b81 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -393,7 +393,7 @@ { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* WindowStatus */ \ { ZAP_EMPTY_DEFAULT(), 0x00000001, 1, ZAP_TYPE(FABRIC_IDX), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* AdminFabricIndex */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(INT16U), \ + { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(VENDOR_ID), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* AdminVendorId */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1186,9 +1186,9 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, // Array of device types #define FIXED_DEVICE_TYPES \ { \ - { 0x0016, 1 }, \ + { 0x00000016, 1 }, \ { \ - 0x0101, 1 \ + 0x00000101, 1 \ } \ } diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 3bf36e7d40a33f..60e861d28cd926 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.10.14' +MIN_ZAP_VERSION = '2023.10.24' class ZapTool: diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index efffda6fed4735..a7a9baddf55cd8 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -15,6 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/nlio.gni") import("${chip_root}/build/chip/buildconfig_header.gni") +import("${chip_root}/src/lib/core/core.gni") import("${chip_root}/src/platform/device.gni") import("common_flags.gni") import("icd/icd.gni") diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 6bd8072425cf42..0f79c1a1d0d5f4 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -45,7 +45,7 @@ using Status = Protocols::InteractionModel::Status; uint16_t ReadHandler::GetPublisherSelectedIntervalLimit() { #if CHIP_CONFIG_ENABLE_ICD_SERVER - return static_cast(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); + return static_cast(ICDManagementServer::GetInstance().GetIdleModeDurationSec()); #else return kSubscriptionMaxIntervalPublisherLimit; #endif @@ -719,17 +719,17 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP #if CHIP_CONFIG_ENABLE_ICD_SERVER - // Default behavior for ICDs where the wanted MaxInterval for a subscription is the IdleModeInterval + // Default behavior for ICDs where the wanted MaxInterval for a subscription is the IdleModeDuration // defined in the ICD Management Cluster. // Behavior can be changed with the OnSubscriptionRequested function defined in the application callbacks // Default Behavior Steps : - // If MinInterval > IdleModeInterval, try to set the MaxInterval to the first interval of IdleModeIntervals above the + // If MinInterval > IdleModeDuration, try to set the MaxInterval to the first interval of IdleModeDurations above the // MinInterval. // If the next interval is greater than the MaxIntervalCeiling, use the MaxIntervalCeiling. - // Otherwise, use IdleModeInterval as MaxInterval + // Otherwise, use IdleModeDuration as MaxInterval - // GetPublisherSelectedIntervalLimit() returns the IdleModeInterval if the device is an ICD + // GetPublisherSelectedIntervalLimit() returns the IdleModeDuration if the device is an ICD uint32_t decidedMaxInterval = GetPublisherSelectedIntervalLimit(); // Check if the PublisherSelectedIntervalLimit is 0. If so, set decidedMaxInterval to MaxIntervalCeiling diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index fe83039c50566d..d6612ebe68e821 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -15,7 +15,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("${chip_root}/build/chip/chip_codegen.gni") -import("${chip_root}/src/lib/core/core.gni") +import("${chip_root}/src/app/common_flags.gni") import("${chip_root}/src/platform/python.gni") _app_root = get_path_info(".", "abspath") @@ -94,7 +94,8 @@ template("chip_data_model") { # is this during app compile but not others? I am unclear what # zap_pregenerated_dir is supposed to convey. Existence of a directory # does not obviously map to "need command handler cpp compiled in"). - if (defined(invoker.zap_pregenerated_dir)) { + if (defined(invoker.zap_pregenerated_dir) && + !chip_build_controller_dynamic_server) { outputs += [ "zap-generated/IMClusterCommandHandler.cpp" ] } else { if (defined(prune_outputs)) { @@ -165,20 +166,25 @@ template("chip_data_model") { "${_app_root}/clusters/scenes-server/SceneTable.h", "${_app_root}/clusters/scenes-server/SceneTableImpl.h", "${_app_root}/clusters/scenes-server/scenes-server.h", - "${_app_root}/util/DataModelHandler.cpp", - "${_app_root}/util/attribute-size-util.cpp", - "${_app_root}/util/attribute-storage.cpp", - "${_app_root}/util/attribute-table.cpp", "${_app_root}/util/binding-table.cpp", "${_app_root}/util/binding-table.h", - "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/generic-callback-stubs.cpp", "${_app_root}/util/message.cpp", "${_app_root}/util/privilege-storage.cpp", - "${_app_root}/util/util.cpp", "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp", ] + if (!chip_build_controller_dynamic_server) { + sources += [ + "${_app_root}/util/DataModelHandler.cpp", + "${_app_root}/util/attribute-size-util.cpp", + "${_app_root}/util/attribute-storage.cpp", + "${_app_root}/util/attribute-table.cpp", + "${_app_root}/util/ember-compatibility-functions.cpp", + "${_app_root}/util/util.cpp", + ] + } + if (defined(invoker.zap_file)) { _zap_file = rebase_path(invoker.zap_file, root_build_dir) _script_args = [ diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index cc8c9ab935550b..39fc5f9cdcc710 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -1171,7 +1171,7 @@ bool ColorControlServer::computeNewHueValue(ColorControlServer::ColorHueTransiti } /** - * @brief Configures EnventControl callback when using HSV colors + * @brief Configures EventControl callback when using HSV colors * * @param endpoint */ @@ -2101,7 +2101,7 @@ uint16_t ColorControlServer::findNewColorValueFromStep(uint16_t oldValue, int16_ } /** - * @brief Configures EnventControl callback when using XY colors + * @brief Configures EventControl callback when using XY colors * * @param endpoint */ @@ -2486,7 +2486,7 @@ uint16_t ColorControlServer::getTemperatureCoupleToLevelMin(EndpointId endpoint) } /** - * @brief Configures EnventControl callback when using Temp colors + * @brief Configures EventControl callback when using Temp colors * * @param endpoint */ @@ -2505,7 +2505,7 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) { // 07-5123-07 (i.e. ZCL 7) 5.2.2.2.1.22 StartUpColorTemperatureMireds Attribute // The StartUpColorTemperatureMireds attribute SHALL define the desired startup color - // temperature values a lamp SHAL use when it is supplied with power and this value SHALL + // temperature values a lamp SHALL use when it is supplied with power and this value SHALL // be reflected in the ColorTemperatureMireds attribute. In addition, the ColorMode and // EnhancedColorMode attributes SHALL be set to 0x02 (color temperature). The values of // the StartUpColorTemperatureMireds attribute are listed in the table below. 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 01edd3f1b60253..3912b022f90065 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -202,6 +202,18 @@ bool DoorLockServer::SetPrivacyModeButton(chip::EndpointId endpointId, bool isEn return SetAttribute(endpointId, Attributes::EnablePrivacyModeButton::Id, Attributes::EnablePrivacyModeButton::Set, isEnabled); } +void DoorLockServer::HandleLocalLockOperationError(chip::EndpointId endpointId, LockOperationTypeEnum opType, + OperationSourceEnum opSource, Nullable userId) +{ + SendLockOperationEvent(endpointId, opType, opSource, OperationErrorEnum::kInvalidCredential, userId, + Nullable(), Nullable(), Nullable>(), + false); + + HandleWrongCodeEntry(endpointId); + + ChipLogProgress(Zcl, "Handling a local Lock Operation Error: [endpoint=%d, user=%d]", endpointId, userId.Value()); +} + bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId) { auto endpointContext = getContext(endpointId); @@ -1815,7 +1827,7 @@ EmberAfStatus DoorLockServer::createUser(chip::EndpointId endpointId, chip::Fabr return static_cast(DlStatus::kOccupied); } - const auto & newUserName = !userName.IsNull() ? userName.Value() : chip::CharSpan::fromCharString(""); + const auto & newUserName = !userName.IsNull() ? userName.Value() : ""_span; auto newUserUniqueId = userUniqueId.IsNull() ? 0xFFFFFFFF : userUniqueId.Value(); auto newUserStatus = userStatus.IsNull() ? UserStatusEnum::kOccupiedEnabled : userStatus.Value(); auto newUserType = userType.IsNull() ? UserTypeEnum::kUnrestrictedUser : userType.Value(); diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index 70988c17786964..a8007f211641a4 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -228,6 +228,20 @@ class DoorLockServer */ void ResetWrongCodeEntryAttempts(chip::EndpointId endpointId); + /** + * @brief Handles a local lock operation error. This method allows handling a wrong attempt of providing + * user credential entry that has been provided locally by the user. The method will emit the LockOperationEvent + * to inform the controller that a local wrong attempt occurred, and also call HandleWrongEntry method to + * increment wrong entry counter. + * + * @param endpointId + * @param opType Operation source to be registered in the LockOperationEvent. + * @param opSource source of the operation to be registered in the LockOperationEvent. + * @param userId Optional user id to be registered in the LockOperationEvent + */ + void HandleLocalLockOperationError(chip::EndpointId endpointId, LockOperationTypeEnum opType, OperationSourceEnum opSource, + Nullable userId); + private: chip::FabricIndex getFabricIndex(const chip::app::CommandHandler * commandObj); chip::NodeId getNodeId(const chip::app::CommandHandler * commandObj); diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 7318523c118fbe..10aa34351230b7 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,8 @@ static Status GroupAdd(FabricIndex fabricIndex, EndpointId endpointId, GroupId g } if (CHIP_NO_ERROR == err) { + MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupTable::Id); return Status::Success; } @@ -109,6 +112,8 @@ static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId, CHIP_ERROR err = provider->RemoveEndpoint(fabricIndex, groupId, endpointId); if (CHIP_NO_ERROR == err) { + MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id, + GroupKeyManagement::Attributes::GroupTable::Id); return EMBER_ZCL_STATUS_SUCCESS; } @@ -322,7 +327,7 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandOb provider->RemoveEndpoint(fabricIndex, commandPath.mEndpointId); status = Status::Success; - + MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupTable::Id); exit: commandObj->AddStatus(commandPath, status); if (Status::Success != status) diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 39bf34c373667e..059d0e915b44b4 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -51,8 +51,8 @@ class IcdManagementAttributeAccess : public app::AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: - CHIP_ERROR ReadIdleModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder); - CHIP_ERROR ReadActiveModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder); + CHIP_ERROR ReadIdleModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder); + CHIP_ERROR ReadActiveModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder); CHIP_ERROR ReadActiveModeThreshold(EndpointId endpoint, AttributeValueEncoder & encoder); CHIP_ERROR ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder); CHIP_ERROR ReadICDCounter(EndpointId endpoint, AttributeValueEncoder & encoder); @@ -65,11 +65,11 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & switch (aPath.mAttributeId) { - case IcdManagement::Attributes::IdleModeInterval::Id: - return ReadIdleModeInterval(aPath.mEndpointId, aEncoder); + case IcdManagement::Attributes::IdleModeDuration::Id: + return ReadIdleModeDuration(aPath.mEndpointId, aEncoder); - case IcdManagement::Attributes::ActiveModeInterval::Id: - return ReadActiveModeInterval(aPath.mEndpointId, aEncoder); + case IcdManagement::Attributes::ActiveModeDuration::Id: + return ReadActiveModeDuration(aPath.mEndpointId, aEncoder); case IcdManagement::Attributes::ActiveModeThreshold::Id: return ReadActiveModeThreshold(aPath.mEndpointId, aEncoder); @@ -87,14 +87,14 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & return CHIP_NO_ERROR; } -CHIP_ERROR IcdManagementAttributeAccess::ReadIdleModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) +CHIP_ERROR IcdManagementAttributeAccess::ReadIdleModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); + return encoder.Encode(ICDManagementServer::GetInstance().GetIdleModeDurationSec()); } -CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) +CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeIntervalMs()); + return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeDurationMs()); } CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeThreshold(EndpointId endpoint, AttributeValueEncoder & encoder) 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 b09e25d7ad75b5..3baf2df84949f4 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -71,9 +72,11 @@ PowerSourceServer gPowerSourceServer; PowerSourceAttrAccess gAttrAccess; #ifdef ZCL_USING_POWER_SOURCE_CLUSTER_SERVER +static constexpr uint16_t kNumStaticEndpoints = EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT; #define POWER_SERVER_NUM_SUPPORTED_ENDPOINTS \ (EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) #else +static constexpr uint16_t kNumStaticEndpoints = 0; #define POWER_SERVER_NUM_SUPPORTED_ENDPOINTS CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT #endif static constexpr size_t kNumSupportedEndpoints = POWER_SERVER_NUM_SUPPORTED_ENDPOINTS; @@ -146,13 +149,8 @@ CHIP_ERROR PowerSourceServer::SetEndpointList(EndpointId powerSourceClusterEndpo { // TODO: should check here that the power source cluster exists on the endpoint, but for now let's take the caller's word // for it - - size_t idx = PowerSourceClusterEndpointIndex(powerSourceClusterEndpoint); - if (idx >= kNumSupportedEndpoints) - { - idx = NextEmptyIndex(); - } - if (idx >= kNumSupportedEndpoints) + uint16_t idx = emberAfGetClusterServerEndpointIndex(powerSourceClusterEndpoint, Clusters::PowerSource::Id, kNumStaticEndpoints); + if (idx == kEmberInvalidEndpointIndex) { return CHIP_ERROR_NO_MEMORY; } @@ -171,8 +169,8 @@ CHIP_ERROR PowerSourceServer::SetEndpointList(EndpointId powerSourceClusterEndpo } const Span * PowerSourceServer::GetEndpointList(EndpointId powerSourceClusterEndpoint) const { - size_t idx = PowerSourceClusterEndpointIndex(powerSourceClusterEndpoint); - if (idx != std::numeric_limits::max()) + uint16_t idx = emberAfGetClusterServerEndpointIndex(powerSourceClusterEndpoint, Clusters::PowerSource::Id, kNumStaticEndpoints); + if (idx != kEmberInvalidEndpointIndex && sPowerSourceClusterInfo[idx].mEndpointList.size() > 0) { return &sPowerSourceClusterInfo[idx].mEndpointList; } @@ -181,10 +179,12 @@ const Span * PowerSourceServer::GetEndpointList(EndpointId powerSour void PowerSourceServer::Shutdown() { +#if POWER_SERVER_NUM_SUPPORTED_ENDPOINTS > 0 for (size_t i = 0; i < kNumSupportedEndpoints; ++i) { sPowerSourceClusterInfo[i].Clear(); } +#endif } size_t PowerSourceServer::GetNumSupportedEndpointLists() const @@ -192,30 +192,6 @@ size_t PowerSourceServer::GetNumSupportedEndpointLists() const return kNumSupportedEndpoints; } -size_t PowerSourceServer::PowerSourceClusterEndpointIndex(EndpointId endpointId) const -{ - for (size_t i = 0; i < kNumSupportedEndpoints; ++i) - { - if (sPowerSourceClusterInfo[i].mClusterEndpoint == endpointId) - { - return i; - } - } - return std::numeric_limits::max(); -} - -size_t PowerSourceServer::NextEmptyIndex() const -{ - for (size_t i = 0; i < kNumSupportedEndpoints; ++i) - { - if (sPowerSourceClusterInfo[i].mClusterEndpoint == kInvalidEndpointId) - { - return i; - } - } - return std::numeric_limits::max(); -} - } // namespace Clusters } // namespace app } // namespace chip diff --git a/src/app/clusters/power-source-server/power-source-server.h b/src/app/clusters/power-source-server/power-source-server.h index a02f54cd5375c1..5199753e16692c 100644 --- a/src/app/clusters/power-source-server/power-source-server.h +++ b/src/app/clusters/power-source-server/power-source-server.h @@ -43,11 +43,6 @@ class PowerSourceServer const Span * GetEndpointList(EndpointId powerSourceClusterEndpoint) const; void Shutdown(); size_t GetNumSupportedEndpointLists() const; - -private: - // Both return std::numeric_limits::max() for not found - size_t PowerSourceClusterEndpointIndex(EndpointId endpointId) const; - size_t NextEmptyIndex() const; }; class PowerSourceAttrAccess : public AttributeAccessInterface diff --git a/src/app/clusters/scenes-server/SceneTableImpl.cpp b/src/app/clusters/scenes-server/SceneTableImpl.cpp index ea894c9d1d108c..f1900416c4499b 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.cpp +++ b/src/app/clusters/scenes-server/SceneTableImpl.cpp @@ -928,8 +928,9 @@ void DefaultSceneTableImpl::SetEndpoint(EndpointId endpoint) void DefaultSceneTableImpl::SetTableSize(uint16_t endpointSceneTableSize) { // Verify the endpoint passed size respects the limits of the device configuration + VerifyOrDie(kMaxScenesPerEndpoint > 0); mMaxScenesPerEndpoint = (kMaxScenesPerEndpoint < endpointSceneTableSize) ? kMaxScenesPerEndpoint : endpointSceneTableSize; - mMaxScenesPerFabric = static_cast(endpointSceneTableSize / 2); + mMaxScenesPerFabric = static_cast((mMaxScenesPerEndpoint - 1) / 2); } DefaultSceneTableImpl::SceneEntryIterator * DefaultSceneTableImpl::IterateSceneEntries(FabricIndex fabric) diff --git a/src/app/clusters/scenes-server/SceneTableImpl.h b/src/app/clusters/scenes-server/SceneTableImpl.h index 3be1dc43e48c26..60a378f43c3ce8 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.h +++ b/src/app/clusters/scenes-server/SceneTableImpl.h @@ -23,12 +23,13 @@ #include #include #include +#include namespace chip { namespace scenes { -static constexpr uint16_t kMaxScenesPerFabric = CHIP_CONFIG_SCENES_MAX_PER_FABRIC; -static constexpr uint16_t kMaxScenesPerEndpoint = CHIP_CONFIG_MAX_SCENES_PER_ENDPOINT; +static constexpr uint16_t kMaxScenesPerFabric = (MATTER_SCENES_TABLE_SIZE - 1) / 2; +static constexpr uint16_t kMaxScenesPerEndpoint = MATTER_SCENES_TABLE_SIZE; using clusterId = chip::ClusterId; diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 39bdba86bd90d3..2386e2155d6722 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -136,8 +136,8 @@ CHIP_ERROR ScenesServer::Init() ChipLogDetail(Zcl, "ERR: getting the scenes FeatureMap on Endpoint %hu Status: %x", endpoint, status); } - // Explicit AttributeValuePairs is mandatory for matter so we force it here - featureMap |= to_underlying(Feature::kExplicit); + // Explicit AttributeValuePairs and TableSize features are mandatory for matter so we force-set them here + featureMap |= (to_underlying(Feature::kExplicit) | to_underlying(Feature::kTableSize)); status = Attributes::FeatureMap::Set(endpoint, featureMap); if (EMBER_ZCL_STATUS_SUCCESS != status) { diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 3ddbe55b157f16..e024d74d61b4b8 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -92,7 +92,7 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & if (DeviceLayer::GetDiagnosticDataProvider().SupportsWatermarks()) { - features.Set(Feature::kWaterMarks); + features.Set(Feature::kWatermarks); } return aEncoder.Encode(features); diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index b404d1487020c2..4f8eb12c39e689 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -22,6 +22,8 @@ EnumsNotUsedAsTypeInXML: - "RvcRunMode::StatusCode" - "RvcCleanMode::ModeTag" - "RvcCleanMode::StatusCode" + - "RvcOperationalState::OperationalStateEnum" + - "RvcOperationalState::ErrorStateEnum" CommandHandlerInterfaceOnlyClusters: # List of clusters that are implemented entirely with diff --git a/src/app/icd/ICDManagementServer.cpp b/src/app/icd/ICDManagementServer.cpp index 0f7cc7ebf5275a..fe41617cfb3a71 100644 --- a/src/app/icd/ICDManagementServer.cpp +++ b/src/app/icd/ICDManagementServer.cpp @@ -39,7 +39,12 @@ Status ICDManagementServer::RegisterClient(PersistentStorageDelegate & storage, // Save entry.checkInNodeID = node_id; entry.monitoredSubject = monitored_subject; - err = entry.SetKey(key); + if (entry.keyHandleValid) + { + entry.DeleteKey(); + } + + err = entry.SetKey(key); VerifyOrReturnError(CHIP_ERROR_INVALID_ARGUMENT != err, InteractionModel::Status::ConstraintError); VerifyOrReturnError(CHIP_NO_ERROR == err, InteractionModel::Status::Failure); err = table.Set(entry.index, entry); diff --git a/src/app/icd/ICDManagementServer.h b/src/app/icd/ICDManagementServer.h index f01de41ad42871..7bb97e39a33dfd 100644 --- a/src/app/icd/ICDManagementServer.h +++ b/src/app/icd/ICDManagementServer.h @@ -33,9 +33,9 @@ using chip::Protocols::InteractionModel::Status; class ICDManagementServer { public: - uint32_t GetIdleModeIntervalSec() { return mIdleInterval_s; } + uint32_t GetIdleModeDurationSec() { return mIdleInterval_s; } - uint32_t GetActiveModeIntervalMs() { return mActiveInterval_ms; } + uint32_t GetActiveModeDurationMs() { return mActiveInterval_ms; } void SetSymmetricKeystore(Crypto::SymmetricKeystore * keyStore) { mSymmetricKeystore = keyStore; } @@ -63,15 +63,15 @@ class ICDManagementServer static ICDManagementServer mInstance; Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr; - static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) <= 64800, - "Spec requires the IdleModeInterval to be equal or inferior to 64800s."); - static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) >= 1, - "Spec requires the IdleModeInterval to be equal or greater to 1s."); - uint32_t mIdleInterval_s = CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC; + static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) <= 64800, + "Spec requires the IdleModeDuration to be equal or inferior to 64800s."); + static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) >= 1, + "Spec requires the IdleModeDuration to be equal or greater to 1s."); + uint32_t mIdleInterval_s = CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC; - static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS) <= (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * kMillisecondsPerSecond), - "Spec requires the IdleModeInterval be equal or greater to the ActiveModeInterval."); - uint32_t mActiveInterval_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS; + static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS) <= (CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC * kMillisecondsPerSecond), + "Spec requires the IdleModeDuration be equal or greater to the ActiveModeDuration."); + uint32_t mActiveInterval_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS; uint16_t mActiveThreshold_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS; diff --git a/src/app/icd/ICDManager.cpp b/src/app/icd/ICDManager.cpp index 134a48ed90463b..456981b09780e1 100644 --- a/src/app/icd/ICDManager.cpp +++ b/src/app/icd/ICDManager.cpp @@ -61,9 +61,9 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT ICDManagementServer::GetInstance().SetSymmetricKeystore(mSymmetricKeystore); // Removing the check for now since it is possible for the Fast polling - // to be larger than the ActiveModeInterval for now - // uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); - // VerifyOrDie(kFastPollingInterval.count() < activeModeInterval); + // to be larger than the ActiveModeDuration for now + // uint32_t activeModeDuration = ICDManagementServer::GetInstance().GetActiveModeDurationMs(); + // VerifyOrDie(kFastPollingInterval.count() < activeModeDuration); UpdateICDMode(); UpdateOperationState(OperationalState::ActiveMode); @@ -138,10 +138,10 @@ void ICDManager::UpdateOperationState(OperationalState state) mOperationalState = OperationalState::IdleMode; // When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode - if (ICDManagementServer::GetInstance().GetActiveModeIntervalMs() > 0) + if (ICDManagementServer::GetInstance().GetActiveModeDurationMs() > 0) { - uint32_t idleModeInterval = ICDManagementServer::GetInstance().GetIdleModeIntervalSec(); - DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(idleModeInterval), OnIdleModeDone, this); + uint32_t idleModeDuration = ICDManagementServer::GetInstance().GetIdleModeDurationSec(); + DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(idleModeDuration), OnIdleModeDone, this); } System::Clock::Milliseconds32 slowPollInterval = GetSlowPollingInterval(); @@ -169,19 +169,19 @@ void ICDManager::UpdateOperationState(OperationalState state) DeviceLayer::SystemLayer().CancelTimer(OnIdleModeDone, this); mOperationalState = OperationalState::ActiveMode; - uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); + uint32_t activeModeDuration = ICDManagementServer::GetInstance().GetActiveModeDurationMs(); - if (activeModeInterval == 0 && !mKeepActiveFlags.HasAny()) + if (activeModeDuration == 0 && !mKeepActiveFlags.HasAny()) { - // A Network Activity triggered the active mode and activeModeInterval is 0. + // A Network Activity triggered the active mode and activeModeDuration is 0. // Stay active for at least Active Mode Threshold. - activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); + activeModeDuration = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); } - DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(activeModeInterval), OnActiveModeDone, this); + DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(activeModeDuration), OnActiveModeDone, this); uint32_t activeModeJitterInterval = - (activeModeInterval >= ICD_ACTIVE_TIME_JITTER_MS) ? activeModeInterval - ICD_ACTIVE_TIME_JITTER_MS : 0; + (activeModeDuration >= ICD_ACTIVE_TIME_JITTER_MS) ? activeModeDuration - ICD_ACTIVE_TIME_JITTER_MS : 0; DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(activeModeJitterInterval), OnTransitionToIdle, this); CHIP_ERROR err = DeviceLayer::ConnectivityMgr().SetPollingInterval(GetFastPollingInterval()); diff --git a/src/app/icd/ICDManager.h b/src/app/icd/ICDManager.h index eac58a17c94d9f..e477e08c8fd24e 100644 --- a/src/app/icd/ICDManager.h +++ b/src/app/icd/ICDManager.h @@ -93,8 +93,8 @@ class ICDManager : public ICDListener static constexpr System::Clock::Milliseconds32 kFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL; // Minimal constraint value of the the ICD attributes. - static constexpr uint32_t kMinIdleModeInterval = 500; - static constexpr uint32_t kMinActiveModeInterval = 300; + static constexpr uint32_t kMinIdleModeDuration = 500; + static constexpr uint32_t kMinActiveModeDuration = 300; static constexpr uint16_t kMinActiveModeThreshold = 300; bool SupportsCheckInProtocol(); diff --git a/src/app/icd/ICDMonitoringTable.cpp b/src/app/icd/ICDMonitoringTable.cpp index cb161a1926b0fe..f47da4187dda65 100644 --- a/src/app/icd/ICDMonitoringTable.cpp +++ b/src/app/icd/ICDMonitoringTable.cpp @@ -72,7 +72,12 @@ CHIP_ERROR ICDMonitoringEntry::Deserialize(TLV::TLVReader & reader) case to_underlying(Fields::kKey): { ByteSpan buf(key.AsMutable()); ReturnErrorOnFailure(reader.Get(buf)); - ReturnErrorOnFailure(this->SetKey(buf)); + // Since we are storing either the raw key or a key ID, we must + // simply copy the data as is in the keyHandle. + // Calling SetKey here would create another key in storage and will cause + // key leakage in some implementation. + memcpy(key.AsMutable(), buf.data(), sizeof(Crypto::Aes128KeyByteArray)); + keyHandleValid = true; } break; default: @@ -90,24 +95,20 @@ void ICDMonitoringEntry::Clear() { this->checkInNodeID = kUndefinedNodeId; this->monitoredSubject = kUndefinedNodeId; - if (symmetricKeystore != nullptr) - { - symmetricKeystore->DestroyKey(this->key); - } + this->keyHandleValid = false; } CHIP_ERROR ICDMonitoringEntry::SetKey(ByteSpan keyData) { VerifyOrReturnError(keyData.size() == sizeof(Crypto::Aes128KeyByteArray), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(symmetricKeystore != nullptr, CHIP_ERROR_INTERNAL); - - // DeleteKey in case the handle was already used. - DeleteKey(); + VerifyOrReturnError(!keyHandleValid, CHIP_ERROR_INTERNAL); Crypto::Aes128KeyByteArray keyMaterial; memcpy(keyMaterial, keyData.data(), sizeof(Crypto::Aes128KeyByteArray)); ReturnErrorOnFailure(symmetricKeystore->CreateKey(keyMaterial, key)); + keyHandleValid = true; return CHIP_NO_ERROR; } @@ -116,6 +117,7 @@ CHIP_ERROR ICDMonitoringEntry::DeleteKey() { VerifyOrReturnError(symmetricKeystore != nullptr, CHIP_ERROR_INTERNAL); symmetricKeystore->DestroyKey(this->key); + keyHandleValid = false; return CHIP_NO_ERROR; } @@ -123,6 +125,7 @@ bool ICDMonitoringEntry::IsKeyEquivalent(ByteSpan keyData) { VerifyOrReturnValue(keyData.size() == Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES, false); VerifyOrReturnValue(symmetricKeystore != nullptr, false); + VerifyOrReturnValue(keyHandleValid, false); ICDMonitoringEntry tempEntry(symmetricKeystore); @@ -187,6 +190,7 @@ CHIP_ERROR ICDMonitoringTable::Set(uint16_t index, const ICDMonitoringEntry & en VerifyOrReturnError(index < this->Limit(), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.checkInNodeID, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.monitoredSubject, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(entry.keyHandleValid, CHIP_ERROR_INVALID_ARGUMENT); ICDMonitoringEntry e(this->mFabric, index); e.checkInNodeID = entry.checkInNodeID; e.monitoredSubject = entry.monitoredSubject; @@ -209,7 +213,7 @@ CHIP_ERROR ICDMonitoringTable::Remove(uint16_t index) // Shift remaining entries down one position while (CHIP_NO_ERROR == this->Get(static_cast(index + 1), entry)) { - this->Set(index++, entry); + ReturnErrorOnFailure(this->Set(index++, entry)); } // Remove last entry diff --git a/src/app/icd/ICDMonitoringTable.h b/src/app/icd/ICDMonitoringTable.h index 4bfd70c772fa65..cf5fa28b4f1138 100644 --- a/src/app/icd/ICDMonitoringTable.h +++ b/src/app/icd/ICDMonitoringTable.h @@ -59,6 +59,22 @@ struct ICDMonitoringEntry : public PersistentData CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override; CHIP_ERROR Deserialize(TLV::TLVReader & reader) override; void Clear() override; + /** + * @brief Set the Key object + * This method will create a new keyHandle. The key handle might contain either + * the raw key or a keyID depending on which Crypto implementation is used. + * To avoid leaking keys, API consumers must either call the DeleteKey method + * or save the entry within the ICDMonitoring Table before this object goes out of scope. + * + * A new entry object should be used for each key when adding entries to the ICDMonitoring + * table. + * + * @param keyData A byte span containing the raw key + * @return CHIP_ERROR CHIP_NO_ERROR success + * CHIP_ERROR_INVALID_ARGUMENT wrong size of the raw key + * CHIP_ERROR_INTERNAL No KeyStore for the entry or Key Handle already present + * CHIP_ERROR_XXX Crypto API related failure + */ CHIP_ERROR SetKey(ByteSpan keyData); CHIP_ERROR DeleteKey(void); @@ -83,6 +99,7 @@ struct ICDMonitoringEntry : public PersistentData chip::NodeId checkInNodeID = kUndefinedNodeId; uint64_t monitoredSubject = static_cast(0); Crypto::Aes128KeyHandle key = Crypto::Aes128KeyHandle(); + bool keyHandleValid = false; uint16_t index = 0; Crypto::SymmetricKeystore * symmetricKeystore = nullptr; }; diff --git a/src/app/icd/ICDNotifier.h b/src/app/icd/ICDNotifier.h index a90f3ddb675089..fc2b8b744c8302 100644 --- a/src/app/icd/ICDNotifier.h +++ b/src/app/icd/ICDNotifier.h @@ -27,7 +27,7 @@ namespace app { /** * The ICDManager implements the ICDListener functions and is always subscribed to the ICDNotifier * This allows other Matter modules to inform the ICDManager that it needs to go and may have to stay in Active Mode, - * outside of its standard ActiveModeInterval and IdleModeInterval, without being tightly coupled the application data model + * outside of its standard ActiveModeDuration and IdleModeDuration, without being tightly coupled the application data model * * This implementation also allows other modules to implement an ICDListener and subscribe to ICDNotifier * to couple behaviours with the ICD cycles. In such cases, ICD_MAX_NOTIFICATION_SUBSCRIBERS need to be adjusted diff --git a/src/app/icd/ICDStateObserver.h b/src/app/icd/ICDStateObserver.h index b9f7dc363f6993..fb9d2c7dde8203 100644 --- a/src/app/icd/ICDStateObserver.h +++ b/src/app/icd/ICDStateObserver.h @@ -17,7 +17,7 @@ #pragma once #ifndef ICD_SLEEP_TIME_JITTER_MS -#define ICD_SLEEP_TIME_JITTER_MS (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * 0.75) +#define ICD_SLEEP_TIME_JITTER_MS (CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC * 0.75) #endif #ifndef ICD_ACTIVE_TIME_JITTER_MS diff --git a/src/app/tests/AppTestContext.cpp b/src/app/tests/AppTestContext.cpp index ac81702d513aed..ffde9dd26021d4 100644 --- a/src/app/tests/AppTestContext.cpp +++ b/src/app/tests/AppTestContext.cpp @@ -41,6 +41,7 @@ namespace Test { CHIP_ERROR AppContext::Init() { ReturnErrorOnFailure(Super::Init()); + ReturnErrorOnFailure(chip::DeviceLayer::PlatformMgr().InitChipStack()); ReturnErrorOnFailure(chip::app::InteractionModelEngine::GetInstance()->Init(&GetExchangeManager(), &GetFabricTable(), app::reporting::GetDefaultReportScheduler())); @@ -57,6 +58,7 @@ void AppContext::Shutdown() Access::ResetAccessControlToDefault(); chip::app::InteractionModelEngine::GetInstance()->Shutdown(); + chip::DeviceLayer::PlatformMgr().Shutdown(); Super::Shutdown(); } diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 122e87bc550ffb..26c0cb0693c532 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -136,7 +136,6 @@ chip_test_suite_using_nltest("tests") { "TestEventLoggingNoUTCTime.cpp", "TestEventOverflow.cpp", "TestEventPathParams.cpp", - "TestExtensionFieldSets.cpp", "TestFabricScopedEventLogging.cpp", "TestICDManager.cpp", "TestICDMonitoringTable.cpp", @@ -148,7 +147,6 @@ chip_test_suite_using_nltest("tests") { "TestPowerSourceCluster.cpp", "TestReadInteraction.cpp", "TestReportingEngine.cpp", - "TestSceneTable.cpp", "TestStatusIB.cpp", "TestStatusResponseMessage.cpp", "TestTimeSyncDataProvider.cpp", @@ -196,8 +194,6 @@ chip_test_suite_using_nltest("tests") { ":binding-test-srcs", ":operational-state-test-srcs", ":ota-requestor-test-srcs", - ":power-cluster-test-srcs", - ":scenes-table-test-srcs", ":time-sync-data-provider-test-srcs", "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", @@ -209,6 +205,17 @@ chip_test_suite_using_nltest("tests") { "${nlunit_test_root}:nlunit-test", ] + if (chip_device_platform != "android") { + test_sources += [ + "TestExtensionFieldSets.cpp", + "TestSceneTable.cpp", + ] + public_deps += [ + ":power-cluster-test-srcs", + ":scenes-table-test-srcs", + ] + } + # Do not run TestCommissionManager when running ICD specific unit tests. # ICDManager has a dependency on the Accessors.h file which causes a link error # when building the TestCommissionManager diff --git a/src/app/tests/TestICDManager.cpp b/src/app/tests/TestICDManager.cpp index 960059040ae75c..3b204df306c06d 100644 --- a/src/app/tests/TestICDManager.cpp +++ b/src/app/tests/TestICDManager.cpp @@ -113,22 +113,22 @@ class TestICDManager ctx->GetIOContext().DriveIO(); } - static void TestICDModeIntervals(nlTestSuite * aSuite, void * aContext) + static void TestICDModeDurations(nlTestSuite * aSuite, void * aContext) { TestContext * ctx = static_cast(aContext); // After the init we should be in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() + 1); // Active mode interval expired, ICDManager transitioned to the IdleMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); - AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()) + 1); + AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(ICDManagementServer::GetInstance().GetIdleModeDurationSec()) + 1); // Idle mode interval expired, ICDManager transitioned to the ActiveMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Events updating the Operation to Active mode can extend the current active mode time by 1 Active mode threshold. // Kick an active Threshold just before the end of the Active interval and validate that the active mode is extended. - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() - 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() - 1); ICDNotifier::GetInstance().BroadcastNetworkActivityNotification(); AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeThresholdMs() / 2); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); @@ -146,7 +146,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kCommissioningWindowOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time so active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() + 1); // Requirement flag still set. We stay in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); @@ -160,12 +160,12 @@ class TestICDManager // Advance time, but by less than the active mode interval and remove the requirement. // We should stay in active mode. - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() / 2); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() / 2); notifier.BroadcastActiveRequestWithdrawal(ActiveFlag::kFailSafeArmed); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time again, The activemode interval is completed. - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() + 1); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); // Set two requirements @@ -173,7 +173,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kExchangeContextOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // advance time so the active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeDurationMs() + 1); // A requirement flag is still set. We stay in active mode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); @@ -196,7 +196,7 @@ namespace { // clang-format off static const nlTest sTests[] = { - NL_TEST_DEF("TestICDModeIntervals", TestICDManager::TestICDModeIntervals), + NL_TEST_DEF("TestICDModeDurations", TestICDManager::TestICDModeDurations), NL_TEST_DEF("TestKeepActivemodeRequests", TestICDManager::TestKeepActivemodeRequests), NL_TEST_SENTINEL() }; diff --git a/src/app/tests/TestICDMonitoringTable.cpp b/src/app/tests/TestICDMonitoringTable.cpp index 867592f4fa2f9a..91430e404188e6 100644 --- a/src/app/tests/TestICDMonitoringTable.cpp +++ b/src/app/tests/TestICDMonitoringTable.cpp @@ -71,6 +71,12 @@ void TestEntryKeyFunctions(nlTestSuite * aSuite, void * aContext) // Test Setting Key NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); + // Test Setting Key again + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INTERNAL == entry.SetKey(ByteSpan(kKeyBuffer1b))); + + // Test Key Deletion + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.DeleteKey()); + // Test Setting Key again NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1b))); @@ -93,24 +99,27 @@ void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) CHIP_ERROR err; // Insert first entry - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); - err = saving.Set(0, entry); + ICDMonitoringEntry entry1(&keystore); + entry1.checkInNodeID = kClientNodeId11; + entry1.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry1.SetKey(ByteSpan(kKeyBuffer1a))); + err = saving.Set(0, entry1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert second entry - entry.checkInNodeID = kClientNodeId12; - entry.monitoredSubject = kClientNodeId11; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer2a))); - err = saving.Set(1, entry); + ICDMonitoringEntry entry2(&keystore); + entry2.checkInNodeID = kClientNodeId12; + entry2.monitoredSubject = kClientNodeId11; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry2.SetKey(ByteSpan(kKeyBuffer2a))); + err = saving.Set(1, entry2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert one too many - entry.checkInNodeID = kClientNodeId13; - entry.monitoredSubject = kClientNodeId13; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer3a))); - err = saving.Set(2, entry); + ICDMonitoringEntry entry3(&keystore); + entry3.checkInNodeID = kClientNodeId13; + entry3.monitoredSubject = kClientNodeId13; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry3.SetKey(ByteSpan(kKeyBuffer3a))); + err = saving.Set(2, entry3); NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); // Retrieve first entry @@ -119,11 +128,7 @@ void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.monitoredSubject); - -// Cannot compare nor retrieve Data if using PSA crypto -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer1a, sizeof(kKeyBuffer1a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1a))); // Retrieve second entry err = loading.Get(1, entry); @@ -131,47 +136,37 @@ void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); - -// Cannot compare nor retrieve Data if using PSA crypto -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer2a))); // No more entries err = loading.Get(2, entry); NL_TEST_ASSERT(aSuite, 2 == loading.Limit()); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == err); - // Overwrite first entry - entry.checkInNodeID = kClientNodeId13; - entry.monitoredSubject = kClientNodeId11; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1b))); - err = saving.Set(0, entry); + // Remove first entry + saving.Remove(0); + ICDMonitoringEntry entry4(&keystore); + entry4.checkInNodeID = kClientNodeId13; + entry4.monitoredSubject = kClientNodeId11; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry4.SetKey(ByteSpan(kKeyBuffer1b))); + err = saving.Set(1, entry4); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); - // Retrieve first entry (modified) + // Retrieve first entry (not modified but shifted) err = loading.Get(0, entry); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); - NL_TEST_ASSERT(aSuite, kClientNodeId13 == entry.checkInNodeID); + NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer2a))); -// Cannot compare nor retrieve Data if using PSA crypto -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer1b, sizeof(kKeyBuffer1b))); -#endif - - // Retrieve second entry (not modified) + // Retrieve second entry err = loading.Get(1, entry); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); - NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); + NL_TEST_ASSERT(aSuite, kClientNodeId13 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); - -// Cannot compare nor retrieve Data if using PSA crypto -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1b))); } void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) @@ -179,39 +174,47 @@ void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) TestPersistentStorageDelegate storage; TestSessionKeystoreImpl keystore; ICDMonitoringTable table(storage, kTestFabricIndex1, kMaxTestClients1, &keystore); - ICDMonitoringEntry entry(&keystore); CHIP_ERROR err; // Invalid checkInNodeID - entry.checkInNodeID = kUndefinedNodeId; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); - err = table.Set(0, entry); + ICDMonitoringEntry entry1(&keystore); + entry1.checkInNodeID = kUndefinedNodeId; + entry1.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry1.SetKey(ByteSpan(kKeyBuffer1a))); + err = table.Set(0, entry1); NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); // Invalid monitoredSubject - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kUndefinedNodeId; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); - err = table.Set(0, entry); + ICDMonitoringEntry entry2(&keystore); + entry2.checkInNodeID = kClientNodeId11; + entry2.monitoredSubject = kUndefinedNodeId; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry2.SetKey(ByteSpan(kKeyBuffer1a))); + err = table.Set(0, entry2); NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); // Invalid key (empty) - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry.SetKey(ByteSpan())); - err = table.Set(0, entry); + ICDMonitoringEntry entry3(&keystore); + entry3.checkInNodeID = kClientNodeId11; + entry3.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry3.SetKey(ByteSpan())); + err = table.Set(0, entry3); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Invalid key (too short) - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry.SetKey(ByteSpan(kKeyBuffer0a))); + ICDMonitoringEntry entry4(&keystore); + entry4.checkInNodeID = kClientNodeId11; + entry4.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry4.SetKey(ByteSpan(kKeyBuffer0a))); + err = table.Set(0, entry4); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); // Invalid key (too long) - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry.SetKey(ByteSpan(kKeyBuffer0b))); + ICDMonitoringEntry entry5(&keystore); + entry5.checkInNodeID = kClientNodeId11; + entry5.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == entry5.SetKey(ByteSpan(kKeyBuffer0b))); + err = table.Set(0, entry5); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); } void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void * aContext) @@ -224,31 +227,35 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void CHIP_ERROR err; // Insert in first fabric - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); - err = table1.Set(0, entry); + ICDMonitoringEntry entry1(&keystore); + entry1.checkInNodeID = kClientNodeId11; + entry1.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry1.SetKey(ByteSpan(kKeyBuffer1a))); + err = table1.Set(0, entry1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert in first fabric - entry.checkInNodeID = kClientNodeId12; - entry.monitoredSubject = kClientNodeId11; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1b))); - err = table1.Set(1, entry); + ICDMonitoringEntry entry2(&keystore); + entry2.checkInNodeID = kClientNodeId12; + entry2.monitoredSubject = kClientNodeId11; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry2.SetKey(ByteSpan(kKeyBuffer1b))); + err = table1.Set(1, entry2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert in second fabric - entry.checkInNodeID = kClientNodeId21; - entry.monitoredSubject = kClientNodeId22; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer2a))); - err = table2.Set(0, entry); + ICDMonitoringEntry entry3(&keystore); + entry3.checkInNodeID = kClientNodeId21; + entry3.monitoredSubject = kClientNodeId22; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry3.SetKey(ByteSpan(kKeyBuffer2a))); + err = table2.Set(0, entry3); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert in second fabric (one too many) - entry.checkInNodeID = kClientNodeId22; - entry.monitoredSubject = kClientNodeId21; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer2b))); - err = table2.Set(1, entry); + ICDMonitoringEntry entry4(&keystore); + entry4.checkInNodeID = kClientNodeId22; + entry4.monitoredSubject = kClientNodeId21; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry4.SetKey(ByteSpan(kKeyBuffer2b))); + err = table2.Set(1, entry4); NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_ARGUMENT == err); // Retrieve fabric1, first entry @@ -257,10 +264,7 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer1a, sizeof(kKeyBuffer1a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1a))); // Retrieve fabric2, second entry err = table1.Get(1, entry); @@ -268,10 +272,7 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer1b, sizeof(kKeyBuffer1b))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1b))); // Retrieve fabric2, first entry err = table2.Get(0, entry); @@ -279,10 +280,7 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void NL_TEST_ASSERT(aSuite, kTestFabricIndex2 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId21 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId22 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer2a))); } void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) @@ -294,25 +292,28 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) ICDMonitoringEntry entry(&keystore); CHIP_ERROR err; - // Insert first entry - entry.checkInNodeID = kClientNodeId11; - entry.monitoredSubject = kClientNodeId12; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer1a))); - err = table1.Set(0, entry); + // Insert in first fabric + ICDMonitoringEntry entry1(&keystore); + entry1.checkInNodeID = kClientNodeId11; + entry1.monitoredSubject = kClientNodeId12; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry1.SetKey(ByteSpan(kKeyBuffer1a))); + err = table1.Set(0, entry1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); - // Insert second entry - entry.checkInNodeID = kClientNodeId12; - entry.monitoredSubject = kClientNodeId11; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer2a))); - err = table1.Set(1, entry); + // Insert in first fabric + ICDMonitoringEntry entry2(&keystore); + entry2.checkInNodeID = kClientNodeId12; + entry2.monitoredSubject = kClientNodeId11; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry2.SetKey(ByteSpan(kKeyBuffer2a))); + err = table1.Set(1, entry2); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Insert in second fabric - entry.checkInNodeID = kClientNodeId21; - entry.monitoredSubject = kClientNodeId22; - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry.SetKey(ByteSpan(kKeyBuffer2a))); - err = table2.Set(0, entry); + ICDMonitoringEntry entry3(&keystore); + entry3.checkInNodeID = kClientNodeId21; + entry3.monitoredSubject = kClientNodeId22; + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == entry3.SetKey(ByteSpan(kKeyBuffer1b))); + err = table2.Set(0, entry3); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == err); // Remove (invalid) @@ -325,10 +326,7 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer1a, sizeof(kKeyBuffer1a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1a))); // Retrieve second entry (not modified) err = table1.Get(1, entry); @@ -336,10 +334,7 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer2a))); // Remove (existing) err = table1.Remove(0); @@ -354,10 +349,7 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) NL_TEST_ASSERT(aSuite, kTestFabricIndex1 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId12 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId11 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer2a))); // Retrieve fabric2, first entry err = table2.Get(0, entry); @@ -365,10 +357,7 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) NL_TEST_ASSERT(aSuite, kTestFabricIndex2 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId21 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId22 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1b))); // Remove all (fabric 1) err = table1.RemoveAll(); @@ -383,10 +372,7 @@ void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) NL_TEST_ASSERT(aSuite, kTestFabricIndex2 == entry.fabricIndex); NL_TEST_ASSERT(aSuite, kClientNodeId21 == entry.checkInNodeID); NL_TEST_ASSERT(aSuite, kClientNodeId22 == entry.monitoredSubject); - -#if !CHIP_CRYPTO_PSA - NL_TEST_ASSERT(aSuite, 0 == memcmp(entry.key.As(), kKeyBuffer2a, sizeof(kKeyBuffer2a))); -#endif + NL_TEST_ASSERT(aSuite, entry.IsKeyEquivalent(ByteSpan(kKeyBuffer1b))); // Remove all (fabric 2) err = table2.RemoveAll(); diff --git a/src/app/tests/TestPowerSourceCluster.cpp b/src/app/tests/TestPowerSourceCluster.cpp index be2b65b3ebcab2..e9983368d57d65 100644 --- a/src/app/tests/TestPowerSourceCluster.cpp +++ b/src/app/tests/TestPowerSourceCluster.cpp @@ -19,6 +19,7 @@ #include "lib/support/CHIPMem.h" #include #include +#include #include #include #include @@ -34,6 +35,21 @@ #include +namespace { +chip::EndpointId numEndpoints = 0; +} +extern uint16_t emberAfGetClusterServerEndpointIndex(chip::EndpointId endpoint, chip::ClusterId cluster, + uint16_t fixedClusterServerEndpointCount) +{ + // Very simple mapping here, we're just going to return the endpoint that matches the given endpoint index because the test + // uses the endpoints in order. + if (endpoint >= numEndpoints) + { + return kEmberInvalidEndpointIndex; + } + return endpoint; +} + namespace chip { namespace app { @@ -144,7 +160,7 @@ void TestPowerSourceCluster::TestEndpointList(nlTestSuite * apSuite, void * apCo // we checked earlier that this fit // This test just uses endpoints in order, so we want to set endpoints from // 0 to numEndpoints - 1, and use this for overflow checking - EndpointId numEndpoints = static_cast(powerSourceServer.GetNumSupportedEndpointLists()); + numEndpoints = static_cast(powerSourceServer.GetNumSupportedEndpointLists()); // Endpoint 0 - list of 5 err = powerSourceServer.SetEndpointList(0, Span(list0)); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 7d7604b1175cce..0898840410f6db 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -340,7 +340,7 @@ class TestReadInteraction static void TestICDProcessSubscribeRequestInfMaxIntervalCeiling(nlTestSuite * apSuite, void * apContext); static void TestICDProcessSubscribeRequestSupMinInterval(nlTestSuite * apSuite, void * apContext); static void TestICDProcessSubscribeRequestMaxMinInterval(nlTestSuite * apSuite, void * apContext); - static void TestICDProcessSubscribeRequestInvalidIdleModeInterval(nlTestSuite * apSuite, void * apContext); + static void TestICDProcessSubscribeRequestInvalidIdleModeDuration(nlTestSuite * apSuite, void * apContext); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER static void TestReadRoundtrip(nlTestSuite * apSuite, void * apContext); static void TestPostSubscribeRoundtripChunkReport(nlTestSuite * apSuite, void * apContext); @@ -1520,7 +1520,7 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi #if CHIP_CONFIG_ENABLE_ICD_SERVER /** - * @brief Test validates that an ICD will choose its IdleModeInterval (GetPublisherSelectedIntervalLimit) + * @brief Test validates that an ICD will choose its IdleModeDuration (GetPublisherSelectedIntervalLimit) * as MaxInterval when the MaxIntervalCeiling is superior. */ void TestReadInteraction::TestICDProcessSubscribeRequestSupMaxIntervalCeiling(nlTestSuite * apSuite, void * apContext) @@ -1581,14 +1581,14 @@ void TestReadInteraction::TestICDProcessSubscribeRequestSupMaxIntervalCeiling(nl err = readHandler.ProcessSubscribeRequest(std::move(subscribeRequestbuf)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - uint16_t idleModeInterval = readHandler.GetPublisherSelectedIntervalLimit(); + uint16_t idleModeDuration = readHandler.GetPublisherSelectedIntervalLimit(); uint16_t minInterval; uint16_t maxInterval; readHandler.GetReportingIntervals(minInterval, maxInterval); NL_TEST_ASSERT(apSuite, minInterval == kMinInterval); - NL_TEST_ASSERT(apSuite, maxInterval == idleModeInterval); + NL_TEST_ASSERT(apSuite, maxInterval == idleModeDuration); } engine->Shutdown(); @@ -1596,7 +1596,7 @@ void TestReadInteraction::TestICDProcessSubscribeRequestSupMaxIntervalCeiling(nl } /** - * @brief Test validates that an ICD will choose its IdleModeInterval (GetPublisherSelectedIntervalLimit) + * @brief Test validates that an ICD will choose its IdleModeDuration (GetPublisherSelectedIntervalLimit) * as MaxInterval when the MaxIntervalCeiling is inferior. */ void TestReadInteraction::TestICDProcessSubscribeRequestInfMaxIntervalCeiling(nlTestSuite * apSuite, void * apContext) @@ -1657,14 +1657,14 @@ void TestReadInteraction::TestICDProcessSubscribeRequestInfMaxIntervalCeiling(nl err = readHandler.ProcessSubscribeRequest(std::move(subscribeRequestbuf)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - uint16_t idleModeInterval = readHandler.GetPublisherSelectedIntervalLimit(); + uint16_t idleModeDuration = readHandler.GetPublisherSelectedIntervalLimit(); uint16_t minInterval; uint16_t maxInterval; readHandler.GetReportingIntervals(minInterval, maxInterval); NL_TEST_ASSERT(apSuite, minInterval == kMinInterval); - NL_TEST_ASSERT(apSuite, maxInterval == idleModeInterval); + NL_TEST_ASSERT(apSuite, maxInterval == idleModeDuration); } engine->Shutdown(); @@ -1672,8 +1672,8 @@ void TestReadInteraction::TestICDProcessSubscribeRequestInfMaxIntervalCeiling(nl } /** - * @brief Test validates that an ICD will choose a multiple of its IdleModeInterval (GetPublisherSelectedIntervalLimit) - * as MaxInterval when the MinInterval > IdleModeInterval. + * @brief Test validates that an ICD will choose a multiple of its IdleModeDuration (GetPublisherSelectedIntervalLimit) + * as MaxInterval when the MinInterval > IdleModeDuration. */ void TestReadInteraction::TestICDProcessSubscribeRequestSupMinInterval(nlTestSuite * apSuite, void * apContext) { @@ -1733,14 +1733,14 @@ void TestReadInteraction::TestICDProcessSubscribeRequestSupMinInterval(nlTestSui err = readHandler.ProcessSubscribeRequest(std::move(subscribeRequestbuf)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - uint16_t idleModeInterval = readHandler.GetPublisherSelectedIntervalLimit(); + uint16_t idleModeDuration = readHandler.GetPublisherSelectedIntervalLimit(); uint16_t minInterval; uint16_t maxInterval; readHandler.GetReportingIntervals(minInterval, maxInterval); NL_TEST_ASSERT(apSuite, minInterval == kMinInterval); - NL_TEST_ASSERT(apSuite, maxInterval == (2 * idleModeInterval)); + NL_TEST_ASSERT(apSuite, maxInterval == (2 * idleModeDuration)); } engine->Shutdown(); @@ -1748,7 +1748,7 @@ void TestReadInteraction::TestICDProcessSubscribeRequestSupMinInterval(nlTestSui } /** - * @brief Test validates that an ICD will choose a maximal value for an uint16 if the multiple of the IdleModeInterval + * @brief Test validates that an ICD will choose a maximal value for an uint16 if the multiple of the IdleModeDuration * is greater than variable size. */ void TestReadInteraction::TestICDProcessSubscribeRequestMaxMinInterval(nlTestSuite * apSuite, void * apContext) @@ -1823,9 +1823,9 @@ void TestReadInteraction::TestICDProcessSubscribeRequestMaxMinInterval(nlTestSui /** * @brief Test validates that an ICD will choose the MaxIntervalCeiling as MaxInterval if the next multiple after the MinInterval - * is greater than the IdleModeInterval and MaxIntervalCeiling + * is greater than the IdleModeDuration and MaxIntervalCeiling */ -void TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeInterval(nlTestSuite * apSuite, void * apContext) +void TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeDuration(nlTestSuite * apSuite, void * apContext) { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); @@ -4935,7 +4935,7 @@ const nlTest sTests[] = NL_TEST_DEF("TestICDProcessSubscribeRequestInfMaxIntervalCeiling", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestInfMaxIntervalCeiling), NL_TEST_DEF("TestICDProcessSubscribeRequestSupMinInterval", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestSupMinInterval), NL_TEST_DEF("TestICDProcessSubscribeRequestMaxMinInterval", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestMaxMinInterval), - NL_TEST_DEF("TestICDProcessSubscribeRequestInvalidIdleModeInterval", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeInterval), + NL_TEST_DEF("TestICDProcessSubscribeRequestInvalidIdleModeDuration", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeDuration), #endif // #if CHIP_CONFIG_ENABLE_ICD_SERVER NL_TEST_DEF("TestSubscribeRoundtrip", chip::app::TestReadInteraction::TestSubscribeRoundtrip), NL_TEST_DEF("TestSubscribeEarlyReport", chip::app::TestReadInteraction::TestSubscribeEarlyReport), diff --git a/src/app/tests/TestSceneTable.cpp b/src/app/tests/TestSceneTable.cpp index cba0ebe4e8d5f5..08ada73b3729a1 100644 --- a/src/app/tests/TestSceneTable.cpp +++ b/src/app/tests/TestSceneTable.cpp @@ -37,6 +37,10 @@ using TransitionTimeMs = scenes::TransitionTimeMs; namespace TestScenes { +// TestTableSize +constexpr uint8_t defaultTestTableSize = 16; +constexpr uint8_t defaultTestFabricCapacity = (defaultTestTableSize - 1) / 2; + // Test Cluster ID constexpr chip::ClusterId kOnOffClusterId = 0x0006; constexpr chip::ClusterId kLevelControlClusterId = 0x0008; @@ -91,6 +95,9 @@ static const SceneStorageId sceneId6(kScene6, kGroup2); static const SceneStorageId sceneId7(kScene7, kGroup3); static const SceneStorageId sceneId8(kScene8, kGroup4); static const SceneStorageId sceneId9(kScene1, kGroup4); +static const SceneStorageId sceneId10(kScene4, kGroup4); +static const SceneStorageId sceneId11(kScene5, kGroup4); +static const SceneStorageId sceneId12(kScene6, kGroup4); CharSpan empty; @@ -107,6 +114,9 @@ static const SceneData sceneData9(CharSpan("Scene #9"), 3000); static const SceneData sceneData10(CharSpan("Scene #10"), 1000); static const SceneData sceneData11(CharSpan("Scene #11"), 50); static const SceneData sceneData12(CharSpan("Scene #12"), 100); +static const SceneData sceneData13(CharSpan("Scene #13"), 100); +static const SceneData sceneData14(CharSpan("Scene #14"), 100); +static const SceneData sceneData15(CharSpan("Scene #15"), 100); // Scenes SceneTableEntry scene1(sceneId1, sceneData1); @@ -120,7 +130,10 @@ SceneTableEntry scene8(sceneId8, sceneData8); SceneTableEntry scene9(sceneId9, sceneData9); SceneTableEntry scene10(sceneId1, sceneData10); SceneTableEntry scene11(sceneId5, sceneData11); -SceneTableEntry scene12(sceneId8, sceneData12); +SceneTableEntry scene12(sceneId7, sceneData12); +SceneTableEntry scene13(sceneId10, sceneData13); +SceneTableEntry scene14(sceneId11, sceneData14); +SceneTableEntry scene15(sceneId12, sceneData15); // Clusters EFS data static app::Clusters::Scenes::Structs::ExtensionFieldSet::Type OOextensionFieldSet; @@ -390,8 +403,7 @@ class TestSceneHandler : public scenes::DefaultSceneHandlerImpl class TestSceneTableImpl : public SceneTableImpl { public: - TestSceneTableImpl(uint16_t maxScenesPerFabric = scenes::kMaxScenesPerFabric, - uint16_t maxScenesGlobal = scenes::kMaxScenesPerEndpoint) : + TestSceneTableImpl(uint16_t maxScenesPerFabric = defaultTestFabricCapacity, uint16_t maxScenesGlobal = defaultTestTableSize) : SceneTableImpl(maxScenesPerFabric, maxScenesGlobal) {} ~TestSceneTableImpl() override {} @@ -427,7 +439,7 @@ void ResetSceneTable(SceneTable * sceneTable) void TestHandlerRegistration(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); TestSceneHandler tmpHandler[scenes::kMaxClustersPerScene]; @@ -480,7 +492,7 @@ void TestHandlerRegistration(nlTestSuite * aSuite, void * aContext) void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerEndpoint); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); @@ -673,16 +685,13 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) void TestStoreScenes(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); - SceneId sceneList[scenes::kMaxScenesPerFabric]; + SceneId sceneList[defaultTestFabricCapacity]; // Reset test ResetSceneTable(sceneTable); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); - NL_TEST_ASSERT(aSuite, nullptr != sceneTable); - VerifyOrReturn(nullptr != sceneTable); // Populate scene1's EFS (Endpoint1) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SceneSaveEFS(scene1)); @@ -722,7 +731,6 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); // Too many scenes for 1 fabric NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric1, scene9)); @@ -754,8 +762,6 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene6); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); NL_TEST_ASSERT(aSuite, scene == scene7); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); - NL_TEST_ASSERT(aSuite, scene == scene8); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SceneApplyEFS(scene)); // Test error when list too small in a full table @@ -785,10 +791,6 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, 1 == sceneListSpan.size()); NL_TEST_ASSERT(aSuite, kScene7 == sceneList[0]); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetAllSceneIdsInGroup(kFabric1, kGroup4, sceneListSpan)); - NL_TEST_ASSERT(aSuite, 1 == sceneListSpan.size()); - NL_TEST_ASSERT(aSuite, kScene8 == sceneList[0]); - uint8_t sceneCount = 0; sceneTable->GetEndpointSceneCount(sceneCount); sceneTable->GetFabricSceneCount(kFabric1, sceneCount); @@ -796,7 +798,7 @@ void TestStoreScenes(nlTestSuite * aSuite, void * aContext) void TestOverwriteScenes(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerEndpoint); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); @@ -818,13 +820,13 @@ void TestOverwriteScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId5, scene)); NL_TEST_ASSERT(aSuite, scene == scene11); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); NL_TEST_ASSERT(aSuite, scene == scene12); } void TestIterateScenes(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerEndpoint); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); @@ -835,7 +837,7 @@ void TestIterateScenes(nlTestSuite * aSuite, void * aContext) if (iterator) { - NL_TEST_ASSERT(aSuite, iterator->Count() == 8); + NL_TEST_ASSERT(aSuite, iterator->Count() == 7); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene10); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); @@ -849,8 +851,6 @@ void TestIterateScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene6); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); - NL_TEST_ASSERT(aSuite, scene == scene7); - NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene12); NL_TEST_ASSERT(aSuite, iterator->Next(scene) == false); @@ -861,7 +861,7 @@ void TestIterateScenes(nlTestSuite * aSuite, void * aContext) void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerEndpoint); + SceneTableImpl * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); @@ -873,7 +873,7 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) // Remove middle NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene5.mStorageId)); auto * iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 7); + NL_TEST_ASSERT(aSuite, iterator->Count() == 6); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene10); iterator->Release(); @@ -881,7 +881,7 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) // Add scene in middle, a spot should have been freed NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene9)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 8); + NL_TEST_ASSERT(aSuite, iterator->Count() == 7); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId9, scene)); NL_TEST_ASSERT(aSuite, scene == scene9); iterator->Release(); @@ -889,7 +889,7 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) // Remove the recently added scene 9 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene9.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 7); + NL_TEST_ASSERT(aSuite, iterator->Count() == 6); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene10); iterator->Release(); @@ -897,7 +897,7 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) // Remove first NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntryAtPosition(kTestEndpoint1, kFabric1, 0)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 6); + NL_TEST_ASSERT(aSuite, iterator->Count() == 5); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene2); iterator->Release(); @@ -905,7 +905,7 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) // Remove Next NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene3.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 5); + NL_TEST_ASSERT(aSuite, iterator->Count() == 4); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene2); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); @@ -914,44 +914,36 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene2.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 4); + NL_TEST_ASSERT(aSuite, iterator->Count() == 3); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene4); iterator->Release(); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene4.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 3); + NL_TEST_ASSERT(aSuite, iterator->Count() == 2); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene6); iterator->Release(); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene6.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, iterator->Count() == 2); - NL_TEST_ASSERT(aSuite, iterator->Next(scene)); - NL_TEST_ASSERT(aSuite, scene == scene7); - iterator->Release(); - - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene7.mStorageId)); - iterator = sceneTable->IterateSceneEntries(kFabric1); NL_TEST_ASSERT(aSuite, iterator->Count() == 1); NL_TEST_ASSERT(aSuite, iterator->Next(scene)); NL_TEST_ASSERT(aSuite, scene == scene12); iterator->Release(); // Remove last - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene8.mStorageId)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, scene7.mStorageId)); iterator = sceneTable->IterateSceneEntries(kFabric1); NL_TEST_ASSERT(aSuite, iterator->Count() == 0); NL_TEST_ASSERT(aSuite, iterator->Next(scene) == false); iterator->Release(); // Remove at empty position, shouldn't trigger error - NL_TEST_ASSERT( - aSuite, - CHIP_NO_ERROR == - sceneTable->RemoveSceneTableEntryAtPosition(kTestEndpoint1, kFabric1, chip::scenes::kMaxScenesPerFabric - 1)); + NL_TEST_ASSERT(aSuite, + CHIP_NO_ERROR == + sceneTable->RemoveSceneTableEntryAtPosition(kTestEndpoint1, kFabric1, defaultTestFabricCapacity - 1)); iterator = sceneTable->IterateSceneEntries(kFabric1); NL_TEST_ASSERT(aSuite, iterator->Count() == 0); @@ -985,26 +977,23 @@ void TestRemoveScenes(nlTestSuite * aSuite, void * aContext) void TestFabricScenes(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); // Reset test ResetSceneTable(sceneTable); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); - NL_TEST_ASSERT(aSuite, nullptr != sceneTable); - VerifyOrReturn(nullptr != sceneTable); SceneTableEntry scene; uint8_t fabric_capacity = 0; // Verify capacities are at max NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Fabric 1 inserts NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1014,39 +1003,38 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); uint8_t scene_count = 0; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric1, scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == scene_count); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == scene_count); // Fabric 2 inserts NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene1)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene2)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene3)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene4)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, (scenes::kMaxScenesPerFabric - 4) == fabric_capacity); + NL_TEST_ASSERT(aSuite, (defaultTestFabricCapacity - 4) == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric2, scene_count)); - NL_TEST_ASSERT(aSuite, 4 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 4 == scene_count); + NL_TEST_ASSERT(aSuite, 11 == scene_count); // Fabric 3 inserts, should only be 4 spaces left at this point since 12 got taken NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestTableSize - 11 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene1)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene2)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene3)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene4)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric2, scene_count)); - NL_TEST_ASSERT(aSuite, 4 == scene_count); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric3, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric3, scene_count)); + NL_TEST_ASSERT(aSuite, 5 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint == scene_count); + NL_TEST_ASSERT(aSuite, defaultTestTableSize == scene_count); // Checks capacity is now 0 accross all fabrics NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); @@ -1057,7 +1045,7 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // To many scenes accross fabrics (Max scenes accross fabrics == 16) - NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric3, scene5)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric3, scene6)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NO_MEMORY == sceneTable->SetSceneTableEntry(kFabric2, scene5)); // Verifying all inserted scenes are accessible @@ -1075,8 +1063,6 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene6); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); NL_TEST_ASSERT(aSuite, scene == scene7); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); - NL_TEST_ASSERT(aSuite, scene == scene8); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); NL_TEST_ASSERT(aSuite, scene == scene1); @@ -1095,6 +1081,8 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene3); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); NL_TEST_ASSERT(aSuite, scene == scene4); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); // Remove Fabric 1 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric1)); @@ -1102,7 +1090,7 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric1, scene_count)); NL_TEST_ASSERT(aSuite, 0 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, 8 == scene_count); + NL_TEST_ASSERT(aSuite, 9 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId2, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId3, scene)); @@ -1126,33 +1114,30 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) // Verify capacity updated for all fabrics NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 4 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 5 == fabric_capacity); // Verify we can now write more scenes in scene fabric 2 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId5, scene)); NL_TEST_ASSERT(aSuite, scene == scene5); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId6, scene)); NL_TEST_ASSERT(aSuite, scene == scene6); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId7, scene)); NL_TEST_ASSERT(aSuite, scene == scene7); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); - NL_TEST_ASSERT(aSuite, scene == scene8); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric2, scene_count)); - NL_TEST_ASSERT(aSuite, 8 == scene_count); + NL_TEST_ASSERT(aSuite, 7 == scene_count); // Verify capacity updated properly NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, 4 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 5 == fabric_capacity); // Verify Fabric 3 still there NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); @@ -1163,6 +1148,8 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene3); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); NL_TEST_ASSERT(aSuite, scene == scene4); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); // Remove Fabric 2 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric2)); @@ -1170,7 +1157,7 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric2, scene_count)); NL_TEST_ASSERT(aSuite, 0 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, 4 == scene_count); + NL_TEST_ASSERT(aSuite, 5 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId2, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId3, scene)); @@ -1178,11 +1165,10 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId5, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId6, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId7, scene)); - NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); // Verify Fabric 3 still there NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric3, scene_count)); - NL_TEST_ASSERT(aSuite, 4 == scene_count); + NL_TEST_ASSERT(aSuite, 5 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId1, scene)); NL_TEST_ASSERT(aSuite, scene == scene1); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); @@ -1191,6 +1177,8 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene3); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); NL_TEST_ASSERT(aSuite, scene == scene4); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric3, sceneId5, scene)); + NL_TEST_ASSERT(aSuite, scene == scene5); // Remove Fabric 3 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveFabric(kFabric3)); @@ -1203,6 +1191,7 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId2, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId3, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId4, scene)); + NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric3, sceneId5, scene)); // Confirm all counts are at 0 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetFabricSceneCount(kFabric1, scene_count)); @@ -1214,52 +1203,48 @@ void TestFabricScenes(nlTestSuite * aSuite, void * aContext) // Verify capacity updated for all fabrics NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric3, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); } void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) { // Get Count for Endpoint 1 - SceneTable * sceneTable = scenes::GetSceneTableImpl(); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); // Reset test ResetSceneTable(sceneTable); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); - NL_TEST_ASSERT(aSuite, nullptr != sceneTable); - VerifyOrReturn(nullptr != sceneTable); - SceneTableEntry scene; // Verify all endpoints are empty uint8_t endpoint_scene_count = 0; // Get Count for Endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Get Count for Endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Get Count for Endpoint 3 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Test Scenes insertion not accessible accross all endpoints - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1269,25 +1254,25 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) uint8_t fabric_capacity = 0; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 1 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 1 == fabric_capacity); // Endpoint2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Endpoint3 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Check if scene present in Endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -1296,13 +1281,13 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene1); // Check if scene present in Endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId1, scene)); // Check if scene present in Endpoint 3 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -1310,7 +1295,7 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) // Test removal on different endpoints do not affect each endpoints // Insertion on Endpoint2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1318,14 +1303,14 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, scene == scene1); // Removal on Endpoint1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, sceneId1)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); // Scene present on Endpoint2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -1335,7 +1320,7 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric1, sceneId1)); // Removal on Endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->RemoveSceneTableEntry(kFabric2, sceneId1)); @@ -1343,13 +1328,13 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); // Endpoint 3 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); @@ -1357,7 +1342,7 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) // Test the fabric capacity accross endpoint // Fill fabric 1 endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1367,7 +1352,6 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); // Fill fabric 2 endpoint 1 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene1)); @@ -1377,7 +1361,6 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); @@ -1385,26 +1368,26 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // Endpoints 2 and 3 should be unaffected - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Verify filling Fabric on endpoint 2 does not affect on endpoint 3 despite Max per fabric being reached by adding Endpoint1 // and Endpoint2 // Fill fabric 1 endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1414,10 +1397,9 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); // Fill fabric 2 endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene1)); @@ -1427,19 +1409,18 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); // scene count to Endpoint - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Test removal of fabric clears scene fabric on all endpoints - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); sceneTable->RemoveFabric(kFabric1); @@ -1452,7 +1433,7 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId7, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -1467,17 +1448,17 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) sceneTable->RemoveFabric(kFabric2); // Validate endpoints are empty - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); NL_TEST_ASSERT(aSuite, 0 == endpoint_scene_count); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(endpoint_scene_count)); @@ -1486,53 +1467,53 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) // Validate Fabric capacities at maximum accross all endpoints // Endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Endpoint 2 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Endpoint 3 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint3, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); // Test of Get with changes to Endpoint capacity // Endpoint 1 - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerEndpoint - 2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize - 2); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 1 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 1 == fabric_capacity); // Test Endpoint 2's capacity remains unaffected - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint2, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == fabric_capacity); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); // Test Insertion then change of capacity - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene1)); @@ -1540,22 +1521,22 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene3)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene4)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 4 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 4 == fabric_capacity); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerFabric - 2); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestFabricCapacity - 2); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 6 == fabric_capacity); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 6 == fabric_capacity); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerFabric - 4); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestFabricCapacity - 4); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // Test making the endpoint scene table smaller than the actual number of scenes on it - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, scenes::kMaxScenesPerFabric - 5); + sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestFabricCapacity - 5); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); @@ -1564,18 +1545,16 @@ void TestEndpointScenes(nlTestSuite * aSuite, void * aContext) void TestOTAChanges(nlTestSuite * aSuite, void * aContext) { - SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); + SceneTable * sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1, defaultTestTableSize); NL_TEST_ASSERT(aSuite, nullptr != sceneTable); VerifyOrReturn(nullptr != sceneTable); // Reset test ResetSceneTable(sceneTable); - sceneTable = scenes::GetSceneTableImpl(kTestEndpoint1); - NL_TEST_ASSERT(aSuite, nullptr != sceneTable); - VerifyOrReturn(nullptr != sceneTable); SceneTableEntry scene; - uint8_t fabric_capacity = 0; + uint8_t fabric_capacity = 0; + uint8_t fabricsFullCount = defaultTestTableSize - 2; // Fill scene table // Fill fabric 1 to capacity @@ -1586,11 +1565,11 @@ void TestOTAChanges(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric1, scene8)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); - auto * iterator = sceneTable->IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == iterator->Count()); + uint8_t scene_table_fabric1_capacity = fabric_capacity; + auto * iterator = sceneTable->IterateSceneEntries(kFabric1); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == iterator->Count()); iterator->Release(); // Fill fabric 2 to capacity @@ -1601,17 +1580,58 @@ void TestOTAChanges(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene5)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene6)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene7)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->SetSceneTableEntry(kFabric2, scene8)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); - iterator = sceneTable->IterateSceneEntries(kFabric2); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric == iterator->Count()); + uint8_t scene_table_fabric2_capacity = fabric_capacity; + iterator = sceneTable->IterateSceneEntries(kFabric2); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity == iterator->Count()); iterator->Release(); // SceneTable should be full at this point uint8_t scene_count; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetEndpointSceneCount(scene_count)); // Global count should not have been modified - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint == scene_count); + NL_TEST_ASSERT(aSuite, fabricsFullCount == scene_count); + + // Create a scene table with a greater capacity than the original one (Max allowed capacity from gen_config.h) + TestSceneTableImpl ExpandedSceneTable(scenes::kMaxScenesPerFabric, scenes::kMaxScenesPerEndpoint); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.Init(&testStorage)); + ExpandedSceneTable.SetEndpoint(kTestEndpoint1); + + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, + scene_table_fabric1_capacity + (scenes::kMaxScenesPerFabric - defaultTestFabricCapacity) == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, + scene_table_fabric2_capacity + (scenes::kMaxScenesPerFabric - defaultTestFabricCapacity) == fabric_capacity); + + // We should be able to insert 4 scenes into fabric 2 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric2, scene9)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric2, scene13)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric2, scene14)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric2, scene15)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + + // Fabric 1's capacity should have remain unchanged + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, + scene_table_fabric1_capacity + (scenes::kMaxScenesPerFabric - defaultTestFabricCapacity) == fabric_capacity); + + // Global count should have increased by (scenes::kMaxScenesPerFarbic - defaultTestFabricCapacity) + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetEndpointSceneCount(scene_count)); + NL_TEST_ASSERT(aSuite, fabricsFullCount + (scenes::kMaxScenesPerFabric - defaultTestFabricCapacity) == scene_count); + + // Same test for 4 insertion in fabric 1 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric1, scene9)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric1, scene13)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric1, scene14)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.SetSceneTableEntry(kFabric1, scene15)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + + // Global count should be at defaultTestTableSize + (scenes::kMaxScenesPerEndpoint - defaultTestTableSize) + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ExpandedSceneTable.GetEndpointSceneCount(scene_count)); + NL_TEST_ASSERT(aSuite, fabricsFullCount + (scenes::kMaxScenesPerEndpoint - defaultTestTableSize) == scene_count); // Test failure to init a SceneTable with sizes above the defined max scenes per fabric or globaly TestSceneTableImpl SceneTableTooManyPerFabric(scenes::kMaxScenesPerFabric + 1, scenes::kMaxScenesPerEndpoint); @@ -1622,16 +1642,21 @@ void TestOTAChanges(nlTestSuite * aSuite, void * aContext) NL_TEST_ASSERT(aSuite, CHIP_ERROR_INVALID_INTEGER_VALUE == SceneTableTooManyGlobal.Init(&testStorage)); SceneTableTooManyGlobal.Finish(); - // Create a new table with a different limit of scenes per fabric - TestSceneTableImpl ReducedSceneTable(scenes::kMaxScenesPerFabric - 1, scenes::kMaxScenesPerEndpoint - 2); + // Create a new table with a lower limit of scenes per fabric + uint8_t newCapacity = defaultTestFabricCapacity - 1; + uint8_t newTableSize = defaultTestTableSize - 2; + uint8_t capacityDifference = static_cast(scenes::kMaxScenesPerFabric - newCapacity); + TestSceneTableImpl ReducedSceneTable(newCapacity, newTableSize); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.Init(&testStorage)); ReducedSceneTable.SetEndpoint(kTestEndpoint1); // Global count should not have been modified NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint == scene_count); + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 2 == scene_count); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // Load a scene from fabric 1, this should adjust fabric 1 scene count in flash NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetSceneTableEntry(kFabric1, sceneId1, scene)); @@ -1639,66 +1664,72 @@ void TestOTAChanges(nlTestSuite * aSuite, void * aContext) // The number count of scenes in Fabric 1 should have been adjusted here iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == iterator->Count()); + NL_TEST_ASSERT(aSuite, newCapacity == iterator->Count()); iterator->Release(); - // Capacity should still be 0 + // Capacity should still be 0 in fabric 1 + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetEndpointSceneCount(scene_count)); - // Global count should have been reduced by 1 - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 1 == scene_count); + // Global count should have been reduced by the difference between the max fabric capacity of a fabric and the + // new fabric capacity since we haven't loaded from fabric 2 yet + NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 2 - capacityDifference == scene_count); // Remove a Scene from the Fabric 1 - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene.mStorageId)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene1.mStorageId)); // Check count updated for fabric iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 2 == iterator->Count()); + NL_TEST_ASSERT(aSuite, static_cast(newCapacity - 1) == iterator->Count()); iterator->Release(); // Check fabric still doesn't have capacity because fabric 2 still have a higher number of scene than allowed NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); // Remove another scene from fabric 1 NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene2.mStorageId)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene3.mStorageId)); + NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.RemoveSceneTableEntry(kFabric1, scene4.mStorageId)); // Check count updated for fabric iterator = ReducedSceneTable.IterateSceneEntries(kFabric1); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 3 == iterator->Count()); + NL_TEST_ASSERT(aSuite, 2 == iterator->Count()); iterator->Release(); - // Global count should now have been adjusted + // Confirm global count has been updated NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 3 == scene_count); - // Confirm we now have capacity + NL_TEST_ASSERT(aSuite, 13 == scene_count); + // Confirm we now have capacity in fabric one NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); NL_TEST_ASSERT(aSuite, 1 == fabric_capacity); - // Load a scene from fabric 2, this should adjust fabric 1 scene count in flash + // Load a scene from fabric 2, this should adjust fabric 2 scene count in flash NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetSceneTableEntry(kFabric2, sceneId1, scene)); NL_TEST_ASSERT(aSuite, scene == scene1); - // The number count of scenes in Fabric 1 should have been adjusted here + // The number count of scenes in Fabric 2 should have been adjusted here iterator = ReducedSceneTable.IterateSceneEntries(kFabric2); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerFabric - 1 == iterator->Count()); + NL_TEST_ASSERT(aSuite, defaultTestFabricCapacity - 1 == iterator->Count()); iterator->Release(); - // Global count should now have been adjusted + // Global count should also have been adjusted NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetEndpointSceneCount(scene_count)); - NL_TEST_ASSERT(aSuite, scenes::kMaxScenesPerEndpoint - 4 == scene_count); - // Confirm we now have capacity in the first fabric since we previously removed 2 scenes form there + // had 22 scenes, truncated 5 from both (10) and deleted 4 from fabric 1: 8 scenes left + NL_TEST_ASSERT(aSuite, 8 == scene_count); + // Confirm we now have capacity of 6 in the first fabric since we previously removed 6 scenes form there NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, 2 == fabric_capacity); + NL_TEST_ASSERT(aSuite, 4 == fabric_capacity); // Fabric 2 should still be at capacity NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == ReducedSceneTable.GetRemainingCapacity(kFabric2, fabric_capacity)); NL_TEST_ASSERT(aSuite, 0 == fabric_capacity); ReducedSceneTable.Finish(); - // The Scene 8 should now have been deleted from the memory and thus not be accessible from both fabrics in the original scene - // table + // The Scene 8 should now have been truncated from the memory and thus not be accessible from both fabrics in the + // original scene table NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric1, sceneId8, scene)); NL_TEST_ASSERT(aSuite, CHIP_ERROR_NOT_FOUND == sceneTable->GetSceneTableEntry(kFabric2, sceneId8, scene)); // The Remaining capacity in the original scene table therefore have been modified as well - // Fabric 2 should still be at capacity + // Fabric 2 should still be almost at capacity NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric1, fabric_capacity)); - NL_TEST_ASSERT(aSuite, 3 == fabric_capacity); + NL_TEST_ASSERT(aSuite, 5 == fabric_capacity); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sceneTable->GetRemainingCapacity(kFabric2, fabric_capacity)); + NL_TEST_ASSERT(aSuite, 1 == fabric_capacity); } diff --git a/src/app/tests/suites/TestIcdManagementCluster.yaml b/src/app/tests/suites/TestIcdManagementCluster.yaml index d04facefdadeb4..25921732bce5b9 100644 --- a/src/app/tests/suites/TestIcdManagementCluster.yaml +++ b/src/app/tests/suites/TestIcdManagementCluster.yaml @@ -28,15 +28,15 @@ tests: - name: "nodeId" value: nodeId - - label: "Read IdleModeInterval" + - label: "Read IdleModeDuration" command: "readAttribute" - attribute: "IdleModeInterval" + attribute: "IdleModeDuration" response: value: 2 - - label: "Read ActiveModeInterval" + - label: "Read ActiveModeDuration" command: "readAttribute" - attribute: "ActiveModeInterval" + attribute: "ActiveModeDuration" response: value: 300 diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index db68712796d160..d94eada4ad6415 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -7584,36 +7584,6 @@ PICS: attribute implemented on the server ?" id: WNCV.C.A001a - - label: - "Does the DUT(client) have access privileges for the (0xFFF8) - GeneratedCommandList attribute implemented on the server ?" - id: WNCV.C.Afff8 - - - label: - "Does the DUT(client) have access privileges for the (0xFFF9) - AcceptedCommandList attribute implemented on the server ?" - id: WNCV.C.Afff9 - - - label: - "Does the DUT(client) have access privileges for the (0xFFFA) - EventList attribute implemented on the server ?" - id: WNCV.C.Afffa - - - label: - "Does the DUT(client) have access privileges for the (0xFFFB) - AttributeList attribute implemented on the server ?" - id: WNCV.C.Afffb - - - label: - "Does the DUT(client) have access privileges for the (0xFFFC) - FeatureMap attribute implemented on the server ?" - id: WNCV.C.Afffc - - - label: - "Does the DUT(client) have access privileges for the (0xFFFD) - ClusterRevision attribute implemented on the server ?" - id: WNCV.C.Afffd - # # client / commandsGenerated # @@ -8578,10 +8548,10 @@ PICS: # # Server Attribute # - - label: "Does the device implement the IdleModeInterval attribute?" + - label: "Does the device implement the IdleModeDuration attribute?" id: ICDM.S.A0000 - - label: "Does the device implement the ActiveModeInterval attribute?" + - label: "Does the device implement the ActiveModeDuration attribute?" id: ICDM.S.A0001 - label: "Does the device implement the ActiveModeThreshold attribute?" @@ -8600,10 +8570,10 @@ PICS: # # Client Attribute # - - label: "Does the device implement the IdleModeInterval attribute?" + - label: "Does the device implement the IdleModeDuration attribute?" id: ICDM.C.A0000 - - label: "Does the device implement the ActiveModeInterval attribute?" + - label: "Does the device implement the ActiveModeDuration attribute?" id: ICDM.C.A0001 - label: "Does the device implement the ActiveModeThreshold attribute?" diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_2.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_2.yaml index 57f3888c65dffe..614a7977ddc59a 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_2.yaml @@ -27,6 +27,43 @@ tests: - label: "Preconditions" verification: | Commission TH to DUT, if not done so already. In some cases, such as with a Casting Video Player, the TH commissions the DUT. + + Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner) or tv-casting-app (when DUT is a commissionee): + + The following command on the example tv-app will launch a content app on endpoint 4: + ./chip-tool applicationlauncher launch-app '{"catalogVendorID": 123, "applicationID": "exampleid"}' 1 1 + ./chip-tv-casting-app applicationlauncher launch-app '{"catalogVendorID": 123, "applicationID": "exampleid"}' 1 1 + On TH (tv-app), Verify the launch app command is received successfully. + 1666779708.066501][24994:24994] CHIP:DMG: InvokeRequestMessage = + [1666779708.066504][24994:24994] CHIP:DMG: { + [1666779708.066507][24994:24994] CHIP:DMG: suppressResponse = false, + [1666779708.066509][24994:24994] CHIP:DMG: timedRequest = false, + [1666779708.066512][24994:24994] CHIP:DMG: InvokeRequests = + [1666779708.066517][24994:24994] CHIP:DMG: [ + [1666779708.066520][24994:24994] CHIP:DMG: CommandDataIB = + [1666779708.066524][24994:24994] CHIP:DMG: { + [1666779708.066527][24994:24994] CHIP:DMG: CommandPathIB = + [1666779708.066532][24994:24994] CHIP:DMG: { + [1666779708.066536][24994:24994] CHIP:DMG: EndpointId = 0x1, + [1666779708.066540][24994:24994] CHIP:DMG: ClusterId = 0x50c, + [1666779708.066545][24994:24994] CHIP:DMG: CommandId = 0x0, + [1666779708.066547][24994:24994] CHIP:DMG: }, + [1666779708.066551][24994:24994] CHIP:DMG: + [1666779708.066553][24994:24994] CHIP:DMG: CommandFields = + [1666779708.066555][24994:24994] CHIP:DMG: { + [1666779708.066557][24994:24994] CHIP:DMG: 0x0 = + [1666779708.066560][24994:24994] CHIP:DMG: { + [1666779708.066566][24994:24994] CHIP:DMG: 0x0 = 123, + [1666779708.066569][24994:24994] CHIP:DMG: 0x1 = "exampleid" (9 chars), + [1666779708.066572][24994:24994] CHIP:DMG: }, + [1666779708.066575][24994:24994] CHIP:DMG: }, + [1666779708.066578][24994:24994] CHIP:DMG: }, + [1666779708.066581][24994:24994] CHIP:DMG: + [1666779708.066583][24994:24994] CHIP:DMG: ], + [1666779708.066586][24994:24994] CHIP:DMG: + [1666779708.066588][24994:24994] CHIP:DMG: InteractionModelRevision = 1 + [1666779708.066590][24994:24994] CHIP:DMG: }, + [1666779708.066602][24994:24994] CHIP:DMG: AccessControl: checking f=2 a=c s=0x000000000001B669 t= c=0x0000_050C e=1 p=o disabled: true - label: "Step 1: DUT sends GetSetupPIN command to TH" diff --git a/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml b/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml index 6493ece836f96e..b00040339a5693 100644 --- a/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml @@ -48,7 +48,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x2] + hasMasksSet: [0x1] - label: "Step 2b: Read the global attribute: FeatureMap" PICS: " !AUDIOOUTPUT.S.F00 " @@ -57,7 +57,7 @@ tests: response: constraints: type: bitmap32 - hasMasksClear: [0x2] + hasMasksClear: [0x1] - label: "Step 3: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_2_2.yaml index bf8b2bbe5f195b..e6496d9fa5c29d 100644 --- a/src/app/tests/suites/certification/Test_TC_BINFO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_BINFO_2_2.yaml @@ -139,13 +139,37 @@ tests: minInterval: 30 maxInterval: 100 - - label: "Verify that ShutDown event has priority set as CRITICAL" + - label: + "Shutdown the DUT and Verify that ShutDown event has priority set as + CRITICAL" + verification: | + To verify ShutDown event follow the below commands , Pls use equivalent command on the respective DUT + + + 1. Launch chip-tool into interactive mode with the command + + ./chip-tool interactive start + + 2. run below command in interactive mode shell and Turn down the DUT + basicinformation subscribe-event shut-down 20 100 1 0 + + verify that ShutDown event as priority set has CRITICAL on TH(Chip-tool) + + CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Event 0x0000_0001 + [1653050528.900202][119367:119372] CHIP:TOO: Event number: 5 + [1653050528.900295][119367:119372] CHIP:TOO: Priority: Critical + [1653050528.900386][119367:119372] CHIP:TOO: Timestamp: 289436805 + [1653050528.900630][119367:119372] CHIP:TOO: ShutDown: { + [1653050528.900732][119367:119372] CHIP:TOO: } + [1653050528.900892][119367:119372] CHIP:DMG: Refresh LivenessCheckTime for 28000 milliseconds with SubscriptionId = 0x27408c83 Peer = 01:0000000000000001 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP && BINFO.S.E01 arguments: values: - name: "message" - value: "If priority set as CRITICAL enter 'y' for success" + value: + "Enter 'y' after successfully ShutDown DUT & priority set as + CRITICAL" - name: "expectedValue" value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml index a37f2954b1c75c..8f37c84f6f6811 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml @@ -172,7 +172,9 @@ tests: verification: | ./chip-tool bridgeddevicebasicinformation write node-label '"newnode"' 1 3 - Verify response has unsupported write on TH(chip-tool) Log: + Via the TH (chip-tool), verify the SUCCESS response for NodeLabel attribute write function. + + Current sample apps do not have this implementation. However, if the vendor has implemented it, the below response will be displayed. NOTE the quotes: single-quote/double-quote/string/double-quote/single-quote @@ -181,7 +183,7 @@ tests: [1660839701.840505][2444:2449] CHIP:DMG: [1660839701.840578][2444:2449] CHIP:DMG: StatusIB = [1660839701.840661][2444:2449] CHIP:DMG: { - [1660839701.840742][2444:2449] CHIP:DMG: status = 0x88 (UNSUPPORTED_WRITE), + [1660839701.840742][2444:2449] CHIP:DMG: status = 0x00 (SUCCESS), [1660839701.840827][2444:2449] CHIP:DMG: }, [1660839701.840905][2444:2449] CHIP:DMG: [1660839701.840973][2444:2449] CHIP:DMG: }, @@ -199,11 +201,12 @@ tests: verification: | ./chip-tool bridgeddevicebasicinformation read node-label 1 3 - Verify the value of node-label is type of string and contains length between 0 and 32 in TH(chip-tool) Log: - Note: If the write access is implemented then the value of the of the Nodelabel will be changed into "newnode" + Via the TH (chip-tool), verify that the NodeLabel attribute value is changed to newnode. + + Current sample apps do not have this implementation. However, if the vendor has implemented it, the below response will be displayed. [1657696463.081741][15476:15481] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0005 DataVersion: 2577979325 - [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: Light 1 + [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: newnode cluster: "LogCommands" command: "UserPrompt" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml index d2811820c14299..1b8aef66aa4404 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_10.yaml @@ -42,6 +42,9 @@ config: incorrectSetupCodePayload: type: char_string defaultValue: "MT:-24J0AFN00I.0648G00" + PIXIT.CADMIN.CwDuration: + type: int16u + defaultValue: 180 tests: - label: "Precondition: Reset Devices to factory defaults" @@ -63,6 +66,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: correctPayload + + - label: "Step 1a: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S @@ -79,9 +93,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 900 + value: PIXIT.CADMIN.CwDuration - label: "Step 2a: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -89,27 +104,14 @@ tests: - name: "ms" value: waitAfterCommissioning - #Check for DNS-SD advertisement CM is not possible in YAML - label: "Step 3: Verify that the DNS-SD advertisement shows CM=1" - verification: | - On TH_CR1 send the below command - - ubuntu@ubuntu:~/may16_cntrl/connectedhomeip/examples/chip-tool/out/debug$ avahi-browse -rt _matterc._udp - + eth0 IPv6 2664ED6939FC373C _matterc._udp local - = eth0 IPv6 2664ED6939FC373C _matterc._udp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "SAI=300" "SII=5000" "VP=65521+32769"] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: + PICS: CADMIN.S.C01.Rsp + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: values: - - name: "message" - value: "enter 'y' after success" - - name: "expectedValue" - value: "y" + - name: "commissioningMode" + value: 1 #As per issue https://github.com/CHIP-Specifications/chip-test-scripts/issues/495 adding --discover-once flag - label: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_16.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_16.yaml index 71469309ace758..1fb1a118bbc453 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_16.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_16.yaml @@ -35,6 +35,9 @@ config: payload: type: char_string defaultValue: "MT:-24J0AFN00KA0648G00" + PIXIT.CADMIN.CwDuration: + type: int16u + defaultValue: 180 tests: - label: "Precondition: Reset Devices to factory defaults" @@ -56,6 +59,18 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + identity: "alpha" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1: TH_CR1 commissioned with DUT_CE" identity: "alpha" cluster: "DelayCommands" command: "WaitForCommissionee" @@ -74,9 +89,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 2a: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -115,9 +131,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 4a: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -200,29 +217,16 @@ tests: response: error: FAILURE - #Issue https://github.com/project-chip/connectedhomeip/issues/21999 - label: "Step 8b: TH_CR2 reads the Basic Information Clusters NodeLabel mandatory attribute of DUT_CE" - PICS: BINFO.S.A0005 && PICS_USER_PROMPT - verification: | - Using TH_CR2 read attribute - - Verify read command fail as expected since the DUT_CE is no longer on the network on TH_CR2 (chip-tool) log - - ./chip-tool basicinformation read node-label 2 0 --commissioner-name beta - - [1678876803.495007][714337:714339] CHIP:SC: Received error (protocol code 1) during pairing process: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root - [1678876803.495018][714337:714339] CHIP:IN: SecureSession[0x7f2764026220]: Released - Type:2 LSID:16528 - [1678876803.495040][714337:714339] CHIP:-: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root at ../../commands/clusters/ModelCommand.cpp:62 - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: BINFO.S.A0005 + identity: "beta" + command: "readAttribute" + cluster: "Basic Information" + attribute: "NodeLabel" + response: + error: FAILURE - label: "Step 9: TH_CR1 reads the list of Fabrics on DUT_CE" identity: "alpha" @@ -232,13 +236,13 @@ tests: attribute: "Fabrics" fabricFiltered: false response: - value: - [ - { Label: "", FabricIndex: 1, NodeID: nodeId }, - { Label: "", FabricIndex: 3, NodeID: nodeId3 }, - ] constraints: type: list + contains: + [ + { Label: "", FabricIndex: 1, NodeID: nodeId }, + { Label: "", FabricIndex: 3, NodeID: nodeId3 }, + ] - label: "Step 11: TH_CR1 opens a commissioning window on DUT_CE using BCM" identity: "alpha" @@ -249,9 +253,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 11a: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -299,14 +304,14 @@ tests: attribute: "Fabrics" fabricFiltered: false response: - value: - [ - { Label: "", FabricIndex: 1, NodeID: nodeId }, - { Label: "", FabricIndex: 4, NodeID: nodeId2 }, - { Label: "", FabricIndex: 3, NodeID: nodeId3 }, - ] constraints: type: list + contains: + [ + { Label: "", FabricIndex: 1, NodeID: nodeId }, + { Label: "", FabricIndex: 4, NodeID: nodeId2 }, + { Label: "", FabricIndex: 3, NodeID: nodeId3 }, + ] - label: "Step 13a: Remove TH2 FabricIndex" PICS: OPCREDS.S.C0a.Rsp && CADMIN.S diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml index cd1141ce8813de..f6e7332a9d1f91 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml @@ -24,6 +24,9 @@ config: nodeId: 0x12344321 timeout: 950 endpoint: 0 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" tests: - label: "Precondition: Reset Devices to factory defaults" @@ -45,6 +48,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S @@ -66,6 +80,7 @@ tests: value: 900 - label: "Step 3: Wait 901 seconds for commissioning Window to be closed" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml index ff0061e4bfd838..4b94b6518a7529 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml @@ -23,6 +23,9 @@ config: nodeId: 0x12344321 timeout: 950 endpoint: 0 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" discriminator: type: int16u defaultValue: 3840 @@ -50,6 +53,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S.C00.Rsp @@ -110,6 +124,7 @@ tests: value: "SPAKE2P Key Salt" - label: "Step 3: Wait for commissioning Window to 901 seconds" + PICS: CADMIN.S.C00.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml index c383ff77a46ad9..9aab51aa3876d2 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml @@ -24,6 +24,9 @@ config: nodeId: 0x12344321 timeout: 200 endpoint: 0 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" tests: - label: "Precondition: Reset Devices to factory defaults" @@ -45,6 +48,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S.C01.Rsp @@ -67,6 +81,7 @@ tests: - label: "Step 3: Wait for 181 seconds for commissioning Window to be closed" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml index 00f27d31146b6e..8e201988cc87db 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml @@ -23,6 +23,9 @@ config: nodeId: 0x12344321 timeout: 200 endpoint: 0 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" discriminator: type: int16u defaultValue: 3840 @@ -50,6 +53,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S.C00.Rsp @@ -110,6 +124,7 @@ tests: value: "SPAKE2P Key Salt" - label: "Step 3: Wait for commissioning Window to 181 seconds" + PICS: CADMIN.S.C00.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_4.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_4.yaml index 01822cf566e147..59b45e1ff87618 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_4.yaml @@ -31,6 +31,9 @@ config: waitAfterCommissioning: type: int16u defaultValue: 5000 + PIXIT.CADMIN.CwDuration: + type: int16u + defaultValue: 180 tests: - label: "Precondition: Reset Devices to factory defaults" @@ -52,6 +55,17 @@ tests: value: "y" - label: "Step 1a: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1a: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S @@ -77,9 +91,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 2a: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -87,27 +102,14 @@ tests: - name: "ms" value: waitAfterCommissioning - #Check for DNS-SD advertisement CM is not possible in YAML - label: "Step 2b: Verify that the DNS-SD advertisement shows CM=1" - verification: | - On TH_CR1 send the below command - - avahi-browse -rt _matterc._udp - + eth0 IPv6 B2822245F1F43570 _matterc._udp local - = eth0 IPv6 B2822245F1F43570 _matterc._udp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "SAI=300" "SII=5000" "VP=65521+32769"] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: + PICS: CADMIN.S.C01.Rsp + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: values: - - name: "message" - value: "enter 'y' after success" - - name: "expectedValue" - value: "y" + - name: "commissioningMode" + value: 1 - label: "Step 2c: TH_CR1 writes the Basic Information Clusters NodeLabel @@ -202,13 +204,21 @@ tests: attribute: "Fabrics" fabricFiltered: false response: - value: - [ - { Label: "", FabricIndex: TH1FabricIndex, NodeID: nodeId }, - { Label: "", FabricIndex: TH2FabricIndex, NodeID: nodeId2 }, - ] constraints: type: list + contains: + [ + { + Label: "", + FabricIndex: TH1FabricIndex, + NodeID: nodeId, + }, + { + Label: "", + FabricIndex: TH2FabricIndex, + NodeID: nodeId2, + }, + ] - label: "Step 6: TH_CR2 reads the list of Fabrics on DUT_CE" identity: "beta" @@ -218,13 +228,21 @@ tests: PICS: OPCREDS.S.A0001 fabricFiltered: false response: - value: - [ - { Label: "", FabricIndex: TH1FabricIndex, NodeID: nodeId }, - { Label: "", FabricIndex: TH2FabricIndex, NodeID: nodeId2 }, - ] constraints: type: list + contains: + [ + { + Label: "", + FabricIndex: TH1FabricIndex, + NodeID: nodeId, + }, + { + Label: "", + FabricIndex: TH2FabricIndex, + NodeID: nodeId2, + }, + ] - label: "Step 7a: TH_CR1 writes the Basic Information Clusters NodeLabel @@ -283,15 +301,16 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 10: Wait for the commissioning window in step 13 to timeout" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 180000 + value: PIXIT.CADMIN.CwDuration * 1000 - label: "Step 11: TH_CR2 reads the window status to verify the DUT_CE window @@ -312,9 +331,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Step 12b: Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_6.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_6.yaml index ae3582acf90fb2..5b1e3340a78821 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_6.yaml @@ -39,6 +39,9 @@ config: payload: type: char_string defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically + PIXIT.CADMIN.CwDuration: + type: int16u + defaultValue: 180 tests: - label: "Precondition: Reset Devices to factory defaults" @@ -60,6 +63,17 @@ tests: value: "y" - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" + cluster: "CommissionerCommands" + command: "PairWithCode" + PICS: CADMIN.S + arguments: + values: + - name: "nodeId" + value: nodeId + - name: "payload" + value: payload + + - label: "Step 1a: TH_CR1 commissioned with DUT_CE" cluster: "DelayCommands" command: "WaitForCommissionee" PICS: CADMIN.S @@ -77,43 +91,25 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - #Check for DNS-SD advertisement CM is not possible in YAML - label: "Step 3: Verify that the DNS-SD advertisement shows CM=1" - verification: | - On TH_CR1 send the below command - - avahi-browse -rt _matterc._udp - + eth0 IPv6 05EB1D3652D2F544 _matterc._udp local - + eth0 IPv6 7869CD25CBF12D42 _matterc._udp local - = eth0 IPv6 7869CD25CBF12D42 _matterc._udp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["PI=" "PH=33" "CM=1" "D=3840" "T=1" "SAI=300" "SII=5000" "VP=65521+32769"] - = eth0 IPv6 05EB1D3652D2F544 _matterc._udp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "SAI=300" "SII=5000" "VP=65521+32769"] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: + PICS: CADMIN.S.C01.Rsp + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: values: - - name: "message" - value: "enter 'y' after success" - - name: "expectedValue" - value: "y" + - name: "commissioningMode" + value: 1 - label: "Wait for PIXIT.CADMIN.CwDuration + 10" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 190000 + value: ( PIXIT.CADMIN.CwDuration + 10 ) * 1000 - label: "Step 4: TH_CR2 starts a commissioning process with DUT_CE" identity: "beta" @@ -137,9 +133,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -203,9 +200,10 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration - label: "Waiting after opening commissioning window" + PICS: CADMIN.S.C01.Rsp cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -222,7 +220,7 @@ tests: arguments: values: - name: "CommissioningTimeout" - value: 180 + value: PIXIT.CADMIN.CwDuration response: error: FAILURE clusterError: 2 diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_4_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_4_Simulated.yaml index dcae56a5d9c56e..3e5b2202221188 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5_4_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_4_Simulated.yaml @@ -39,16 +39,6 @@ tests: PICS: CC.C.C07.Tx && CC.C.F03 wait: "MoveToColor" - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C07.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C07.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "Wait for ConfigTransitionTime" cluster: "DelayCommands" command: "WaitForMs" @@ -57,30 +47,10 @@ tests: - name: "ms" value: ConfigTransitionTime - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C07.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C07.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "DUT sends MoveColor command to TH" PICS: CC.C.C08.Tx && CC.C.F03 wait: "MoveColor" - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C08.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C08.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "Wait for ConfigTransitionTime" cluster: "DelayCommands" command: "WaitForMs" @@ -89,30 +59,10 @@ tests: - name: "ms" value: ConfigTransitionTime - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C08.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C08.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "DUT sends StepColor command to TH" PICS: CC.C.C09.Tx wait: "StepColor" - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C09.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C09.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "Wait for ConfigTransitionTime" cluster: "DelayCommands" command: "WaitForMs" @@ -121,30 +71,10 @@ tests: - name: "ms" value: ConfigTransitionTime - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C09.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C09.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "DUT sends StopMoveStep command to TH" PICS: CC.C.C47.Tx wait: "StopMoveStep" - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C47.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: "DUT reads CurrentY attribute from TH(potentially multiple times)" - PICS: CC.C.C47.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" - - label: "Wait for ConfigTransitionTime" cluster: "DelayCommands" command: "WaitForMs" @@ -152,15 +82,3 @@ tests: values: - name: "ms" value: ConfigTransitionTime - - - label: "DUT reads CurrentX attribute from TH(potentially multiple times)" - PICS: CC.C.C47.Tx && CC.C.A0003 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentX" - - - label: - "DUT reads CurrentY attribute from ConfiguredTime: type: int16u - defaultValue: 30000TH(potentially multiple times)" - PICS: CC.C.C47.Tx && CC.C.A0004 && CC.C.F03 - wait: "readAttribute" - attribute: "CurrentY" diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_1.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_1.yaml index 2dcdf1d54f9ddf..b4d15c1bc8a879 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_1.yaml @@ -25,6 +25,14 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 4. TH can communicate with the DUT + disabled: true + - label: "Step 1: Factory reset the DUT" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml index e0adf7ec94ea14..b9d5fed77a9909 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml @@ -26,15 +26,12 @@ config: endpoint: 0 tests: - - label: "Precondition" + - label: "Preconditions" verification: | - Commission TH and DUT on Thread setup - - The cluster Identifier 49 (0x0031) is present in the ServerList attribute - - The FeatureMap attribute value is 2 - - MaxNetworks attribute value is at least 1 which is saved as 'MaxNetworksValue' for future use + 1. DUT supports CNET.S.F01(TH) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + 3. DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 4. TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET disabled: true - label: @@ -92,7 +89,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network hex:1850171990782922 62 0 + ./chip-tool networkcommissioning remove-network hex:1850171990782922 62 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the NetworkConfigResponse that contains Networking Status value as 0 (success). @@ -230,7 +227,7 @@ tests: disabled: true - label: - "Step 11: TH sends ArmFailSafe command to the DUT with + "Step 13: TH sends ArmFailSafe command to the DUT with ExpiryLengthSeconds set to 900" verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 @@ -248,7 +245,7 @@ tests: disabled: true - label: - "Step 12: TH sends RemoveNetwork Command to the DUT with NetworkID + "Step 14: TH sends RemoveNetwork Command to the DUT with NetworkID field set to extended PAN ID of PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET and Breadcrumb field set to 1" PICS: CNET.S.C04.Rsp && CNET.S.C05.Tx @@ -271,7 +268,7 @@ tests: [1657791030.762608][5336:5341] CHIP:EM: Sending Standalone Ack for MessageCounter:266194732 on exchange 7795i disabled: true - - label: "Step 13: TH sends the CommissioningComplete command to the DUT" + - label: "Step 15: TH sends the CommissioningComplete command to the DUT" PICS: CNET.S.C04.Rsp verification: | ./chip-tool generalcommissioning commissioning-complete 1 0 @@ -289,7 +286,7 @@ tests: disabled: true - label: - "Step 14: TH sends ArmFailSafe command to the DUT with + "Step 16: TH sends ArmFailSafe command to the DUT with ExpiryLengthSeconds set to 0 to ensure the CommissioningComplete call properly persisted the failsafe context. This call should have no effect if Commissioning Complete call is handled correctly" @@ -309,7 +306,7 @@ tests: [1657626274.219632][2802:2807] CHIP:EM: Sending Standalone Ack for MessageCounter:52231112 on exchange 13160i disabled: true - - label: "Step 15: TH reads Networks attribute from the DUT" + - label: "Step 17: TH reads Networks attribute from the DUT" PICS: CNET.S.A0001 verification: | ./chip-tool networkcommissioning read networks 1 0 diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml index 2f32c50b2622de..69e25476c127e1 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml @@ -26,59 +26,17 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" + - label: "Preconditions" verification: | - All the below commands are to check the Pre-Condition note mentioned in D column. + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 4. TH can connect to two valid Wi-Fi access points: PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID and PIXIT.CNET.WIFI_2ND_ACCESSPOINT_SSID disabled: true - - label: - "The cluster Identifier 49 (0x0031) is present in the ServerList - attribute" - verification: | - ./chip-tool descriptor read server-list 1 0 - - Verify the "descriptor" on the TH(Chip-tool) log - - [1653478221.662178][27661:27666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1626448966 - [1653478221.662314][27661:27666] CHIP:TOO: server list: 26 entries - [1653478221.662350][27661:27666] CHIP:TOO: [1]: 3 - [1653478221.662376][27661:27666] CHIP:TOO: [2]: 4 - [1653478221.662401][27661:27666] CHIP:TOO: [3]: 29 - [1653478221.662426][27661:27666] CHIP:TOO: [4]: 30 - [1653478221.662450][27661:27666] CHIP:TOO: [5]: 31 - [1653478221.662474][27661:27666] CHIP:TOO: [6]: 40 - [1653478221.662499][27661:27666] CHIP:TOO: [7]: 42 - [1653478221.662523][27661:27666] CHIP:TOO: [8]: 43 - [1653478221.662548][27661:27666] CHIP:TOO: [9]: 44 - [1653478221.662572][27661:27666] CHIP:TOO: [10]: 45 - [1653478221.662596][27661:27666] CHIP:TOO: [11]: 46 - [1653478221.662621][27661:27666] CHIP:TOO: [12]: 47 - [1653478221.662645][27661:27666] CHIP:TOO: [13]: 48 - [1653478221.662669][27661:27666] CHIP:TOO: [14]: 49 - [1653478221.662693][27661:27666] CHIP:TOO: [15]: 50 - [1653478221.662717][27661:27666] CHIP:TOO: [16]: 51 - [1653478221.662742][27661:27666] CHIP:TOO: [17]: 52 - [1653478221.662766][27661:27666] CHIP:TOO: [18]: 53 - [1653478221.662791][27661:27666] CHIP:TOO: [19]: 54 - [1653478221.662815][27661:27666] CHIP:TOO: [20]: 55 - [1653478221.662839][27661:27666] CHIP:TOO: [21]: 60 - [1653478221.662863][27661:27666] CHIP:TOO: [22]: 62 - [1653478221.662888][27661:27666] CHIP:TOO: [23]: 63 - [1653478221.662912][27661:27666] CHIP:TOO: [24]: 64 - [1653478221.662937][27661:27666] CHIP:TOO: [25]: 65 - [1653478221.662962][27661:27666] CHIP:TOO: [26]: 1029 - disabled: true - - - label: "The FeatureMap attribute value is 1" + - label: "Commission TH and DUT over BLE to setup the Wi-Fi" verification: | - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify the "feature-map" on the TH(Chip-tool) log - [1653478255.044168][27668:27673] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 3424382863 - [1653478255.044240][27668:27673] CHIP:TOO: FeatureMap: 1 - [1653478255.044352][27668:27673] CHIP:EM: Sending Standalone Ack for MessageCounter:8977728 on exchange 59777i - [1653478255.044428][27668:27673] CHIP:IN: Prepared secure message 0xffffa77ed958 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 5 disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_12.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_12.yaml index e5a47b29eaff8e..8180610da3e8ec 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_12.yaml @@ -26,19 +26,16 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT on Thread setup" - verification: | - - disabled: true - - - label: - "The cluster Identifier 49 (0x0031) is present in the ServerList - attribute" + - label: "Preconditions" verification: | - + 1. DUT supports CNET.S.F01(TH) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + 3. TH has can communicate to two valid thread PANs: PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET and PIXIT.CNET.THREAD_2ND_OPERATIONALDATASET + 4. TH can connect to two valid Wi-Fi access points: PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID and PIXIT.CNET.WIFI_2ND_ACCESSPOINT_SSID + 5. XPANID of PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET is saved as th_xpan and the XPANID of PIXIT.CNET.THREAD_2ND_OPERATIONALDATASET is saved as th_xpan1 disabled: true - - label: "The FeatureMap attribute value is 2" + - label: "Commission TH and DUT on Thread setup" verification: | disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_13.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_13.yaml index cb22eeb6278225..d2dbeb418f9f25 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_13.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_13.yaml @@ -26,71 +26,17 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" - verification: | - - disabled: true - - - label: - "The cluster Identifier 49 (0x0031) is present in the ServerList - attribute" - verification: | - ./chip-tool descriptor read server-list 1 0 - - Verify the "server-list" on the TH(Chip-tool) log - - [1653474860.462391][29901:29906] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1237231415 - [1653474860.462487][29901:29906] CHIP:TOO: server list: 25 entries - [1653474860.462524][29901:29906] CHIP:TOO: [1]: 3 - [1653474860.462549][29901:29906] CHIP:TOO: [2]: 4 - [1653474860.462574][29901:29906] CHIP:TOO: [3]: 29 - [1653474860.462598][29901:29906] CHIP:TOO: [4]: 30 - [1653474860.462622][29901:29906] CHIP:TOO: [5]: 31 - [1653474860.462646][29901:29906] CHIP:TOO: [6]: 40 - [1653474860.462670][29901:29906] CHIP:TOO: [7]: 42 - [1653474860.462693][29901:29906] CHIP:TOO: [8]: 43 - [1653474860.462717][29901:29906] CHIP:TOO: [9]: 44 - [1653474860.462741][29901:29906] CHIP:TOO: [10]: 45 - [1653474860.462765][29901:29906] CHIP:TOO: [11]: 46 - [1653474860.462788][29901:29906] CHIP:TOO: [12]: 48 - [1653474860.462812][29901:29906] CHIP:TOO: [13]: 49 - [1653474860.462836][29901:29906] CHIP:TOO: [14]: 50 - [1653474860.462859][29901:29906] CHIP:TOO: [15]: 51 - [1653474860.462883][29901:29906] CHIP:TOO: [16]: 52 - [1653474860.462906][29901:29906] CHIP:TOO: [17]: 53 - [1653474860.462930][29901:29906] CHIP:TOO: [18]: 54 - [1653474860.462954][29901:29906] CHIP:TOO: [19]: 55 - [1653474860.462977][29901:29906] CHIP:TOO: [20]: 60 - [1653474860.463001][29901:29906] CHIP:TOO: [21]: 62 - [1653474860.463024][29901:29906] CHIP:TOO: [22]: 63 - [1653474860.463048][29901:29906] CHIP:TOO: [23]: 64 - [1653474860.463071][29901:29906] CHIP:TOO: [24]: 65 - [1653474860.463095][29901:29906] CHIP:TOO: [25]: 1029 - [1653474860.463296][29901:29906] CHIP:EM: Sending Standalone Ack for MessageCounter:10703464 on exchange 2435i - disabled: true - - - label: "The FeatureMap attribute value is 1" + - label: "Preconditions" verification: | - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify the "feature-map" on the TH(Chip-tool) log - - [1653474932.055513][29920:29925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1600858167 - [1653474932.055578][29920:29925] CHIP:TOO: FeatureMap: 1 - [1653474932.055675][29920:29925] CHIP:EM: Sending Standalone Ack for MessageCounter:1494059 on exchange 5482i + 1. Commission TH and DUT over BLE to setup the Wi-Fi on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 2. The cluster Identifier 49 (0x0031) is present in the ServerList attribute + 3. The FeatureMap attribute value is 1 + 4. MaxNetworks attribute value is at least 2 which is saved as 'MaxNetworksValue' for future use disabled: true - - label: - "MaxNetworks attribute value is at least 4 which is saved as - MaxNetworksValue for future use" + - label: "Commission TH and DUT over BLE to setup the Wi-Fi" verification: | - The test case is not verifiable. As MaxNetworks value is 1 but expected is 4 - - ./chip-tool networkcommissioning read max-networks 1 0 - [1653476960.303444][30164:30169] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000 DataVersion: 1600858167 - [1653476960.303531][30164:30169] CHIP:TOO: MaxNetworks: 1 - [1653476960.303641][30164:30169] CHIP:EM: Sending Standalone Ack for MessageCounter:2083922 on exchange 45120i disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml index 1e9edd3b231a91..3ec06b2aa609bc 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml @@ -28,69 +28,10 @@ config: tests: - label: "Preconditions" verification: | - Commission TH and DUT on Thread setup - disabled: true - - - label: - "Preconditions: The cluster Identifier 49 (0x0031) is present in the - ServerList attribute" - verification: | - ./chip-tool descriptor read server-list 1 0 - - Verify the "server-list" on the TH(Chip-tool) log - - [1653474860.462391][29901:29906] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1237231415 - [1653474860.462487][29901:29906] CHIP:TOO: server list: 25 entries - [1653474860.462524][29901:29906] CHIP:TOO: [1]: 3 - [1653474860.462549][29901:29906] CHIP:TOO: [2]: 4 - [1653474860.462574][29901:29906] CHIP:TOO: [3]: 29 - [1653474860.462598][29901:29906] CHIP:TOO: [4]: 30 - [1653474860.462622][29901:29906] CHIP:TOO: [5]: 31 - [1653474860.462646][29901:29906] CHIP:TOO: [6]: 40 - [1653474860.462670][29901:29906] CHIP:TOO: [7]: 42 - [1653474860.462693][29901:29906] CHIP:TOO: [8]: 43 - [1653474860.462717][29901:29906] CHIP:TOO: [9]: 44 - [1653474860.462741][29901:29906] CHIP:TOO: [10]: 45 - [1653474860.462765][29901:29906] CHIP:TOO: [11]: 46 - [1653474860.462788][29901:29906] CHIP:TOO: [12]: 48 - [1653474860.462812][29901:29906] CHIP:TOO: [13]: 49 - [1653474860.462836][29901:29906] CHIP:TOO: [14]: 50 - [1653474860.462859][29901:29906] CHIP:TOO: [15]: 51 - [1653474860.462883][29901:29906] CHIP:TOO: [16]: 52 - [1653474860.462906][29901:29906] CHIP:TOO: [17]: 53 - [1653474860.462930][29901:29906] CHIP:TOO: [18]: 54 - [1653474860.462954][29901:29906] CHIP:TOO: [19]: 55 - [1653474860.462977][29901:29906] CHIP:TOO: [20]: 60 - [1653474860.463001][29901:29906] CHIP:TOO: [21]: 62 - [1653474860.463024][29901:29906] CHIP:TOO: [22]: 63 - [1653474860.463048][29901:29906] CHIP:TOO: [23]: 64 - [1653474860.463071][29901:29906] CHIP:TOO: [24]: 65 - [1653474860.463095][29901:29906] CHIP:TOO: [25]: 1029 - [1653474860.463296][29901:29906] CHIP:EM: Sending Standalone Ack for MessageCounter:10703464 on exchange 2435i - disabled: true - - - label: "Preconditions: The FeatureMap attribute value is 2" - verification: | - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify the "feature-map" on the TH(Chip-tool) log - - [1653474932.055513][29920:29925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1600858167 - [1653474932.055578][29920:29925] CHIP:TOO: FeatureMap: 1 - [1653474932.055675][29920:29925] CHIP:EM: Sending Standalone Ack for MessageCounter:1494059 on exchange 5482i - disabled: true - - - label: - "Preconditions: MaxNetworks attribute value is at least 4 which is - saved as 'MaxNetworksValue' for future use" - verification: | - The test case is not verifiable. As MaxNetworks value is 1 but expected is 4 - - ./chip-tool networkcommissioning read max-networks 1 0 - - [1653476960.303444][30164:30169] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000 DataVersion: 1600858167 - [1653476960.303531][30164:30169] CHIP:TOO: MaxNetworks: 1 - [1653476960.303641][30164:30169] CHIP:EM: Sending Standalone Ack for MessageCounter:2083922 on exchange 45120i + 1. Commission TH and DUT on Thread setup on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 2. The cluster Identifier 49 (0x0031) is present in the ServerList attribute + 3. The FeatureMap attribute value is 2 + 4. MaxNetworks attribute value is at least 2 which is saved as 'MaxNetworksValue' for future use disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_15.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_15.yaml index b7c35be94be112..df0a9776df37f5 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_15.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_15.yaml @@ -28,11 +28,12 @@ config: tests: - label: "Preconditions" verification: | - 1. Factory Reset the DUT - 2. Commission TH and DUT to setup the Thread - 3. The cluster Identifier 49 (0x0031) is present in the ServerList attribute - 4. The FeatureMap attribute value is 1 - 5. MaxNetworks attribute value is at least 1 which is saved as MaxNetworksValue for future use + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is factory reset + 4. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 5. TH can communicate with the DUT + 6. DUT MaxNetworks attribute value is at least 1 and is saved as 'MaxNetworksValue' for future use disabled: true - label: @@ -63,7 +64,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 + ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the NetworkConfigResponse that contains Networking Status value as 3 (NetworkIDNotFound). @@ -86,7 +87,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning connect-network hex:47524C50726976617465 1 0 + ./chip-tool networkcommissioning connect-network hex:47524C50726976617465 1 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the ConnectNetworkResponse that contains Networking Status value as 3 (NetworkIDNotFound). diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_16.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_16.yaml index 36bff6e14ec43a..102e7f809ff4fe 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_16.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_16.yaml @@ -28,11 +28,12 @@ config: tests: - label: "Preconditions" verification: | - 1. Factory Reset the DUT - 2. Commission TH and DUT to setup the Thread - 3. The cluster Identifier 49 (0x0031) is present in the ServerList attribute - 4. The FeatureMap attribute value is 2 - 5. MaxNetworks attribute value is at least 1 which is saved as MaxNetworksValue for future use + 1. DUT supports CNET.S.F01(TH) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + 3. DUT is factory reset + 4. DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 5. TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 6. DUT MaxNetworks attribute value is at least 1 and is saved as 'MaxNetworksValue' for future use disabled: true - label: @@ -64,7 +65,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network 2111111122222222 54 0 + ./chip-tool networkcommissioning remove-network 2111111122222222 54 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the NetworkConfigResponse that contains Networking Status value as 3 (NetworkIDNotFound). @@ -92,7 +93,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning connect-network 47524C50726976617465 54 0 + ./chip-tool networkcommissioning connect-network 47524C50726976617465 54 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the ConnectNetworkResponse that contains Networking Status value as 3 (NetworkIDNotFound). diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml index c0b1f8c1426294..2fa7fd06383799 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml @@ -26,6 +26,14 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1. DUT supports CNET.S.F01(TH) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + 3. DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 4. TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + disabled: true + - label: "Step 1: Factory reset the DUT" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_20.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_20.yaml index fdf638a8642b67..1446d5ccb4bb43 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_20.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_20.yaml @@ -25,6 +25,12 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1. DUT supports CNET.C.F00(WI) + 2. TH has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + disabled: true + - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as client test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_21.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_21.yaml index b7760d99147f37..617fc26a394c5d 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_21.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_21.yaml @@ -26,6 +26,12 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1. DUT supports CNET.C.F01(TH) + 2. TH has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + disabled: true + - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as client test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml index 9736cb5e626781..410a4ca2b56751 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml @@ -32,7 +32,6 @@ tests: 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 3. DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET 4. TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET - disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_3.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_3.yaml index 0f7d9b22494073..e65428f1878632 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_3.yaml @@ -25,6 +25,14 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1. DUT supports CNET.S.F02(ET) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_ETHERNET with FeatureMap attribute of 4 + 3. DUT has a valid Ethernet connection + 4. TH can communicate with the DUT + disabled: true + - label: "Step 1: Factory reset the DUT" verification: | @@ -130,7 +138,13 @@ tests: - label: "Step 8: TH reads InterfaceEnabled attribute from the DUT" PICS: CNET.S.A0004 verification: | + ./chip-tool networkcommissioning read interface-enabled 1 0 + + Via the TH (chip-tool), Verify the InterfaceEnabled attribute that contains bool value as True. + [1653473893.275901][29834:29839] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0004 DataVersion: 1600858167 + [1653473893.275964][29834:29839] CHIP:TOO: InterfaceEnabled: TRUE + [1653473893.276084][29834:29839] CHIP:EM: Sending Standalone Ack for MessageCounter:13157245 on exchange 55578i disabled: true - label: "Step 9: TH reads LastNetworkingStatus attribute from the DUT" diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_4.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_4.yaml index 1e07d5dd88ee02..26493ea10e7c1c 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_4.yaml @@ -26,58 +26,17 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" - verification: | - - disabled: true - - - label: - "The cluster Identifier 49 (0x0031) in present in the ServerList - attribute" + - label: "Preconditions" verification: | - ./chip-tool descriptor read server-list 1 0 - - Verify tthe "descriptor" on the TH(Chip-tool) Log: - - [1653474860.462391][29901:29906] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1237231415 - [1653474860.462487][29901:29906] CHIP:TOO: server list: 25 entries - [1653474860.462524][29901:29906] CHIP:TOO: [1]: 3 - [1653474860.462549][29901:29906] CHIP:TOO: [2]: 4 - [1653474860.462574][29901:29906] CHIP:TOO: [3]: 29 - [1653474860.462598][29901:29906] CHIP:TOO: [4]: 30 - [1653474860.462622][29901:29906] CHIP:TOO: [5]: 31 - [1653474860.462646][29901:29906] CHIP:TOO: [6]: 40 - [1653474860.462670][29901:29906] CHIP:TOO: [7]: 42 - [1653474860.462693][29901:29906] CHIP:TOO: [8]: 43 - [1653474860.462717][29901:29906] CHIP:TOO: [9]: 44 - [1653474860.462741][29901:29906] CHIP:TOO: [10]: 45 - [1653474860.462765][29901:29906] CHIP:TOO: [11]: 46 - [1653474860.462788][29901:29906] CHIP:TOO: [12]: 48 - [1653474860.462812][29901:29906] CHIP:TOO: [13]: 49 - [1653474860.462836][29901:29906] CHIP:TOO: [14]: 50 - [1653474860.462859][29901:29906] CHIP:TOO: [15]: 51 - [1653474860.462883][29901:29906] CHIP:TOO: [16]: 52 - [1653474860.462906][29901:29906] CHIP:TOO: [17]: 53 - [1653474860.462930][29901:29906] CHIP:TOO: [18]: 54 - [1653474860.462954][29901:29906] CHIP:TOO: [19]: 55 - [1653474860.462977][29901:29906] CHIP:TOO: [20]: 60 - [1653474860.463001][29901:29906] CHIP:TOO: [21]: 62 - [1653474860.463024][29901:29906] CHIP:TOO: [22]: 63 - [1653474860.463048][29901:29906] CHIP:TOO: [23]: 64 - [1653474860.463071][29901:29906] CHIP:TOO: [24]: 65 - [1653474860.463095][29901:29906] CHIP:TOO: [25]: 1029 - [1653474860.463296][29901:29906] CHIP:EM: Sending Standalone Ack for MessageCounter:10703464 on exchange 2435i + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 4. TH can communicate with the DUT disabled: true - - label: "The FeatureMap attribute value is 1" + - label: "Commission TH and DUT over BLE to setup the Wi-Fi" verification: | - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify the "feature-map" on the TH(Chip-tool) Log: - [1653474932.055513][29920:29925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1600858167 - [1653474932.055578][29920:29925] CHIP:TOO: FeatureMap: 1 - [1653474932.055675][29920:29925] CHIP:EM: Sending Standalone Ack for MessageCounter:1494059 on exchange 5482i disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml index 3f1a7cedf164f6..d50e856b4c2501 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml @@ -28,20 +28,10 @@ config: tests: - label: "Preconditions" verification: | - 1.Commission TH and DUT over BLE to setup the Wi-Fi - - 2.The cluster Identifier 49 (0x0031) is present in the ServerList - attribute - - 3.The FeatureMap attribute value is 1 - - ./chip-tool networkcommissioning read feature-map 1 0 - - Via the TH (chip-tool), verify that FeatureMap attribute value as 1 for WiFiNetworkInterface. - - [1653474932.055513][29920:29925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1600858167 - [1653474932.055578][29920:29925] CHIP:TOO: FeatureMap: 1 - [1653474932.055675][29920:29925] CHIP:EM: Sending Standalone Ack for MessageCounter:1494059 on exchange 5482i" + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 4. TH can communicate with the DUT disabled: true - label: @@ -55,7 +45,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning add-or-update-wi-fi-network hex:47524C50726976617465 grlprivatewifi092010 1 0 + ./chip-tool networkcommissioning add-or-update-wi-fi-network hex:47524C50726976617465 grlprivatewifi092010 1 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the AddOrUpdateWiFiNetwork command. @@ -74,7 +64,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 + ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the RemoveNetwork command. @@ -87,13 +77,13 @@ tests: "Step 3: TH sends ConnectNetwork command to the DUT with NetworkID field set to PIXIT.CNET.WIFI_1ST_ACCE SSPOINT_SSID and Breadcrumb field set to 1" - PICS: CNET.S.C02.Rsp + PICS: CNET.S.C06.Rsp verification: | ./chip-tool networkcommissioning connect hex: 1 0 Below is an example: - ./chip-tool networkcommissioning connect-network hex:47524C50726976617465 1 0 + ./chip-tool networkcommissioning connect-network hex:47524C50726976617465 1 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the ConnectNetwork command. diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_6.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_6.yaml index 5e45f04efa7a9b..e9f1368e4c79cb 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_6.yaml @@ -26,19 +26,15 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT on Thread setup" - verification: | - - disabled: true - - - label: - "The cluster Identifier 49 (0x0031) is present in the ServerList - attribute" + - label: "Preconditions" verification: | - + 1. DUT supports CNET.S.F01(TH) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2 + 3. DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET + 4. TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET disabled: true - - label: "The FeatureMap attribute value is 2" + - label: "Commission TH and DUT on Thread setup" verification: | disabled: true @@ -53,7 +49,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning add-or-update-thread-network hex:1011101122222229 51 0 + ./chip-tool networkcommissioning add-or-update-thread-network hex:1011101122222229 51 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the AddOrUpdateThreadNetwork command. @@ -72,7 +68,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network hex:1011101122222229 51 0 + ./chip-tool networkcommissioning remove-network hex:1011101122222229 51 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the RemoveNetwork command. @@ -91,7 +87,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning connect-network hex:1011101122222229 51 0 + ./chip-tool networkcommissioning connect-network hex:1011101122222229 51 0 --Breadcrumb 1 Via the TH (chip-tool), verify the FAILSAFE_REQUIRED response for sending the ConnectNetwork command. diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_9.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_9.yaml index 8a4565b3f310dd..5963e9bbae6801 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_9.yaml @@ -26,86 +26,17 @@ config: endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" - verification: | - - disabled: true - - - label: - "The cluster Identifier 49 (0x0031) is present in the ServerList - attribute" + - label: "Preconditions" verification: | - ./chip-tool descriptor read server-list 1 0 - - Via the TH (chip-tool), verify that the server list has value as 49. - - [1653474860.462391][29901:29906] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1237231415 - [1653474860.462487][29901:29906] CHIP:TOO: server list: 25 entries - [1653474860.462524][29901:29906] CHIP:TOO: [1]: 3 - [1653474860.462549][29901:29906] CHIP:TOO: [2]: 4 - [1653474860.462574][29901:29906] CHIP:TOO: [3]: 29 - [1653474860.462598][29901:29906] CHIP:TOO: [4]: 30 - [1653474860.462622][29901:29906] CHIP:TOO: [5]: 31 - [1653474860.462646][29901:29906] CHIP:TOO: [6]: 40 - [1653474860.462670][29901:29906] CHIP:TOO: [7]: 42 - [1653474860.462693][29901:29906] CHIP:TOO: [8]: 43 - [1653474860.462717][29901:29906] CHIP:TOO: [9]: 44 - [1653474860.462741][29901:29906] CHIP:TOO: [10]: 45 - [1653474860.462765][29901:29906] CHIP:TOO: [11]: 46 - [1653474860.462788][29901:29906] CHIP:TOO: [12]: 48 - [1653474860.462812][29901:29906] CHIP:TOO: [13]: 49 - [1653474860.462836][29901:29906] CHIP:TOO: [14]: 50 - [1653474860.462859][29901:29906] CHIP:TOO: [15]: 51 - [1653474860.462883][29901:29906] CHIP:TOO: [16]: 52 - [1653474860.462906][29901:29906] CHIP:TOO: [17]: 53 - [1653474860.462930][29901:29906] CHIP:TOO: [18]: 54 - [1653474860.462954][29901:29906] CHIP:TOO: [19]: 55 - [1653474860.462977][29901:29906] CHIP:TOO: [20]: 60 - [1653474860.463001][29901:29906] CHIP:TOO: [21]: 62 - [1653474860.463024][29901:29906] CHIP:TOO: [22]: 63 - [1653474860.463048][29901:29906] CHIP:TOO: [23]: 64 - [1653474860.463071][29901:29906] CHIP:TOO: [24]: 65 - [1653474860.463095][29901:29906] CHIP:TOO: [25]: 1029 - [1653474860.463296][29901:29906] CHIP:EM: Sending Standalone Ack for MessageCounter:10703464 on exchange 2435i - disabled: true - - - label: "The FeatureMap attribute value is 1" - verification: | - ./chip-tool networkcommissioning read feature-map 1 0 - - Via the TH (chip-tool), verify that FeatureMap attribute value as 1 for WiFi NetworkInterface. - - [1653474932.055513][29920:29925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1600858167 - [1653474932.055578][29920:29925] CHIP:TOO: FeatureMap: 1 - [1653474932.055675][29920:29925] CHIP:EM: Sending Standalone Ack for MessageCounter:1494059 on exchange 5482i + 1. DUT supports CNET.S.F00(WI) + 2. DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_WIFI with FeatureMap attribute of 1 + 3. DUT is commissioned on PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID + 4. TH can communicate with the DUT disabled: true - - label: "The Networks attribute value is 1 entries" - verification: | - ./chip-tool networkcommissioning read networks 1 0 - - Verify the "networks" on the TH(Chip-tool) log - - [1653478044.910989][30351:30356] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0001 DataVersion: 1600858167 - [1653478044.911109][30351:30356] CHIP:TOO: Networks: 1 entries - [1653478044.911192][30351:30356] CHIP:TOO: [1]: { - [1653478044.911238][30351:30356] CHIP:TOO: NetworkID: 47524C50726976617465 - [1653478044.911280][30351:30356] CHIP:TOO: Connected: TRUE - [1653478044.911322][30351:30356] CHIP:TOO: } - [1653478044.911474][30351:30356] CHIP:EM: Sending Standalone Ack for MessageCounter:3575760 on exchange 51774i - disabled: true - - - label: - "MaxNetworks attribute value is at least 1 which is saved as - MaxNetworksValue for future use" + - label: "Commission TH and DUT over BLE to setup the Wi-Fi" verification: | - ./chip-tool networkcommissioning read max-networks 1 0 - Via the TH (chip-tool), Verify the MaxNetworks attribute that contains value in the range of 1 to 255. - - [1653476960.303444][30164:30169] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_0000 DataVersion: 1600858167 - [1653476960.303531][30164:30169] CHIP:TOO: MaxNetworks: 1 - [1653476960.303641][30164:30169] CHIP:EM: Sending Standalone Ack for MessageCounter:2083922 on exchange 45120i disabled: true - label: @@ -168,7 +99,7 @@ tests: Below is an example: - ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 + ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 --Breadcrumb 1 Via the TH (chip-tool), Verify the NetworkConfigResponse that contains Networking Status value as 0 (success). @@ -280,7 +211,7 @@ tests: [1657288382.006263][2369:2374] CHIP:TOO: } disabled: true - - label: "Step 10: TH reads Networks attribute from the DUT" + - label: "Step 12: TH reads Networks attribute from the DUT" PICS: CNET.S.A0001 verification: | ./chip-tool networkcommissioning read networks 1 0 @@ -299,7 +230,7 @@ tests: disabled: true - label: - "Step 11: TH sends ArmFailSafe command to the DUT with + "Step 13: TH sends ArmFailSafe command to the DUT with ExpiryLengthSeconds set to 900" verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 @@ -315,7 +246,7 @@ tests: disabled: true - label: - "Step 12: TH sends RemoveNetwork Command to the DUT with NetworkID + "Step 14: TH sends RemoveNetwork Command to the DUT with NetworkID field set to PIXIT.CNET.WIFI_1ST_ACCESSPOINT_SSID and Breadcrumb field set to 1" PICS: CNET.S.C04.Rsp && CNET.S.C05.Tx @@ -335,7 +266,7 @@ tests: [1687240172.757062][17509:17511] CHIP:TOO: } disabled: true - - label: "Step 13: TH sends the CommissioningComplete command to the DUT" + - label: "Step 15: TH sends the CommissioningComplete command to the DUT" PICS: CNET.S.C04.Rsp verification: | ./chip-tool generalcommissioning commissioning-complete 1 0 @@ -351,7 +282,7 @@ tests: disabled: true - label: - "Step 14: TH sends ArmFailSafe command to the DUT with + "Step 16: TH sends ArmFailSafe command to the DUT with ExpiryLengthSeconds set to 0 to ensure the CommissioningComplete call properly persisted the failsafe context. This call should have no effect if Commissioning Complete call is handled correctly" @@ -368,7 +299,7 @@ tests: [1657288529.987772][2404:2409] CHIP:TOO: } disabled: true - - label: "Step 15: TH reads Networks attribute from the DUT" + - label: "Step 17: TH reads Networks attribute from the DUT" PICS: CNET.S.A0001 verification: | ./chip-tool networkcommissioning read networks 1 0 diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_4.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_4.yaml index db416d3c119f35..61cfc3a8043207 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_4.yaml @@ -36,6 +36,14 @@ tests: 1. PAA, PAI, DAC certificates are obtained and validated 2. Operations happen within the Fail-Safe Context 3. TH1 should be known about Commissioner based error condition/warning + + (for all steps, PIs use equivalent command on their respective platform) + set the $CHIP_ROOT environment variable to the location of the connectedhomeip directory or if you are validating image pls send this command in apps folder (cd to the connectedhomeip directory, use command `export CHIP_ROOT=$(pwd -P)` + For each scenario outlined in the sheet TC-DA-1.8 test cases, perform the following actions + - Start the TH using the required certificate set and PID. For chip-all-clusters-app, use the command given in the chip-all-clusters app command column + - Have the DUT commission the TH. Verify that the DUT indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface. + - factory reset the TH + command when using chip-all-clusters-app: sudo rm -rf /tmp/chip_* disabled: true - label: "Step 1: Start the commissioning process of TH1 on DUT" @@ -156,262 +164,3261 @@ tests: disabled: true - label: - "Verify that DUT notifies a warning stating that Commissionee is not a - fully trusted device.Verify that the warning contains the information - about the reason for error condition If the warning message indicates - that Commissioning is allowed then confirm that CSRRequest Command is - sent from DUT to TH1" + "Step 5: Verify that DUT notifies a warning stating that Commissionee + is not a fully trusted device.Verify that the warning contains the + information about the reason for error condition If the warning + message indicates that Commissioning is allowed then confirm that + CSRRequest Command is sent from DUT to TH1" PICS: MCORE.DA.ATTEST_WARNING verification: | Verify if DUT reports any warning stating that the commissionee is not a fully trusted device. However per Matter spec, Commissioners SHOULD warn the user (its not a SHALL requirement) and commissioners choose their implementation and May give the user a choice to authorize or deny commissioning disabled: true - - label: "Step 6: Factory Reset TH1 so that it is commissionable again" + - label: "Step 6: Factory Reset TH so that it is commissionable again" verification: | - To perform Factory reset on TH1(all-clusters-app) follow the below step in RPI platform , Pls use equivalent command on the respective platform - sudo rm -rf /tmp/chip_* + To perform Factory reset on TH1(all-clusters-app) follow the below step in RPI platform , Pls use equivalent command on the respective platformsudo rm -rf /tmp/chip_* + disabled: true + + - label: + "Step 7: For each of the test cases in the Certificates for TC-DA-1.4 + table, start the TH using the appropriate certificate set, commission + the TH using the DUT, then factory reset the TH." + verification: | + Test step has beeen validated in below steps disabled: true - label: - "Step 7: Repeat step 1 to step 7 and for step 5 set different error - condition as below: Commissionees PAA is not in the Commissioners - trusted set. Commissionee provides an invalid DAC and PAI chain as - validated by TH against the RFC5280 certificate Basic path validation - algorithm Commissionee provides DAC with validity period that is not - in range of PAA/PAI" + "Step 1: CD Test Vector: The dac_origin_vendor_id fild is present and + dac_origin_product_id fields is not present." verification: | - For each error scenario Factory reset on TH1(all-clusters-app) as explained in step 6 + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset - 1. For error scenario 1 i.e. Commissionee’s PAA is not in the Commissioner’s trusted set. + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_present_pid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + o 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997151.715871][74557:74557] CHIP:IN: (S) Sending msg 185139947 on secure session with LSID: 15692 + [1693997151.715909][74557:74557] CHIP:DMG: Command handler moving to [CommandSen] + [1693997151.715913][74557:74557] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997151.715920][74557:74557] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997151.715924][74557:74557] CHIP:SVR: Failsafe timer expired + [1693997151.715927][74557:74557] CHIP:IN: SecureSession[0x556dff7aaae0]: MarkForEviction Type:1 LSID:15692 + [1693997151.715930][74557:74557] CHIP:SC: SecureSession[0x556dff7aaae0, LSID:15692]: State change 'kActive' --> 'kPendingEviction' + [1693997151.715943][74557:74557] CHIP:IN: SecureSession[0x556dff7aaae0]: Released - Type:1 LSID:15692 + [1693997151.715951][74557:74557] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997151.715967][74557:74557] CHIP:IN: SecureSession[0x556dff7aaae0]: Allocated Type:1 LSID:15694 + [1693997151.715972][74557:74557] CHIP:SC: Assigned local session key ID 15694 + [1693997151.715975][74557:74557] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 2: DAC Test Vector: Fallback VID and PID encoding example: + invalid, PID not present and VID not upper case" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_12/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994403.341228][73449:73449] CHIP:DMG: } + [1693994403.341231][73449:73449] CHIP:DMG: + [1693994403.341246][73449:73449] CHIP:EM: <<< [E:30736r S:60388 M:219410600 (Ack:261280417)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994403.341254][73449:73449] CHIP:IN: (S) Sending msg 219410600 on secure session with LSID: 60388 + [1693994403.341291][73449:73449] CHIP:DMG: Command handler moving to [CommandSen] + [1693994403.341294][73449:73449] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994403.341301][73449:73449] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994403.341305][73449:73449] CHIP:SVR: Failsafe timer expired + [1693994403.341309][73449:73449] CHIP:IN: SecureSession[0x560da40688c0]: MarkForEviction Type:1 LSID:60388 + [1693994403.341312][73449:73449] CHIP:SC: SecureSession[0x560da40688c0, LSID:60388]: State change 'kActive' --> 'kPendingEviction' + [1693994403.341329][73449:73449] CHIP:IN: SecureSession[0x560da40688c0]: Released - Type:1 LSID:60388 + [1693994403.341338][73449:73449] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994403.341356][73449:73449] CHIP:IN: SecureSession[0x560da40688c0]: Allocated Type:1 LSID:60390 + [1693994403.341362][73449:73449] CHIP:SC: Assigned local session key ID 60390 + [1693994403.341366][73449:73449] CHIP:SC: Waiting for PBKDF param request + [1693994403.341374][73449:73449] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 3: DAC Test Vector: Invalid certificate signature algorithm + ECDSA_WITH_SHA1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_sig_algo_ecdsa_with_sha1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996211.521552][74117:74117] CHIP:EM: <<< [E:25185r S:53710 M:167691966 (Ack:245625616)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996211.521560][74117:74117] CHIP:IN: (S) Sending msg 167691966 on secure session with LSID: 53710 + [1693996211.521595][74117:74117] CHIP:DMG: Command handler moving to [CommandSen] + [1693996211.521599][74117:74117] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996211.521607][74117:74117] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996211.521611][74117:74117] CHIP:SVR: Failsafe timer expired + [1693996211.521615][74117:74117] CHIP:IN: SecureSession[0x5581d19b2a70]: MarkForEviction Type:1 LSID:53710 + [1693996211.521619][74117:74117] CHIP:SC: SecureSession[0x5581d19b2a70, LSID:53710]: State change 'kActive' --> 'kPendingEviction' + [1693996211.521637][74117:74117] CHIP:IN: SecureSession[0x5581d19b2a70]: Released - Type:1 LSID:53710 + [1693996211.521648][74117:74117] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996211.521669][74117:74117] CHIP:IN: SecureSession[0x5581d19b2a70]: Allocated Type:1 LSID:53712 + [1693996211.521677][74117:74117] CHIP:SC: Assigned local session key ID 53712 + disabled: true + + - label: "Step 4: CD Test Vector: The product_id_array field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993840.870308][72883:72883] CHIP:DMG: + [1693993840.870320][72883:72883] CHIP:EM: <<< [E:37569r S:15994 M:123922316 (Ack:203861491)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993840.870328][72883:72883] CHIP:IN: (S) Sending msg 123922316 on secure session with LSID: 15994 + [1693993840.870361][72883:72883] CHIP:DMG: Command handler moving to [CommandSen] + [1693993840.870365][72883:72883] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993840.870379][72883:72883] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993840.870384][72883:72883] CHIP:SVR: Failsafe timer expired + [1693993840.870389][72883:72883] CHIP:IN: SecureSession[0x557e71225ce0]: MarkForEviction Type:1 LSID:15994 + [1693993840.870392][72883:72883] CHIP:SC: SecureSession[0x557e71225ce0, LSID:15994]: State change 'kActive' --> 'kPendingEviction' + [1693993840.870409][72883:72883] CHIP:IN: SecureSession[0x557e71225ce0]: Released - Type:1 LSID:15994 + [1693993840.870420][72883:72883] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993840.870445][72883:72883] CHIP:IN: SecureSession[0x557e71225ce0]: Allocated Type:1 LSID:15996 + [1693993840.870450][72883:72883] CHIP:SC: Assigned local session key ID 15996 + [1693993840.870456][72883:72883] CHIP:SC: Waiting for PBKDF param request + [1693993840.870464][72883:72883] CHIP:DIS: Updating services using commissioning mode 1 + [1693993840.870767][72883:72883] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993840.871098][72883:72883] CHIP:DL: Using wifi MAC for hostname + [1693993840.871172][72883:72883] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 5: PAI Test Vector: Certificate validity period starts in the + past" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_valid_in_past/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + o 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994803.098470][73608:73608] CHIP:IN: (S) Sending msg 223928797 on secure session with LSID: 25230 + [1693994803.098520][73608:73608] CHIP:DMG: Command handler moving to [CommandSen] + [1693994803.098523][73608:73608] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994803.098530][73608:73608] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994803.098533][73608:73608] CHIP:SVR: Failsafe timer expired + [1693994803.098537][73608:73608] CHIP:IN: SecureSession[0x562e2718c880]: MarkForEviction Type:1 LSID:25230 + [1693994803.098541][73608:73608] CHIP:SC: SecureSession[0x562e2718c880, LSID:25230]: State change 'kActive' --> 'kPendingEviction' + [1693994803.098556][73608:73608] CHIP:IN: SecureSession[0x562e2718c880]: Released - Type:1 LSID:25230 + [1693994803.098564][73608:73608] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994803.098580][73608:73608] CHIP:IN: SecureSession[0x562e2718c880]: Allocated Type:1 LSID:25232 + [1693994803.098585][73608:73608] CHIP:SC: Assigned local session key ID 25232 + [1693994803.098588][73608:73608] CHIP:SC: Waiting for PBKDF param request + [1693994803.098596][73608:73608] CHIP:DIS: Updating services using commissioning mode 1 + [1693994803.098836][73608:73608] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 6: CD Test Vector: The product_id_array field has 100 PID values + none of which matches the PID value in DAC." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count100_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997405.995023][74683:74683] CHIP:DMG: + [1693997405.995034][74683:74683] CHIP:EM: <<< [E:36876r S:41477 M:993220 (Ack:208381418)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997405.995041][74683:74683] CHIP:IN: (S) Sending msg 993220 on secure session with LSID: 41477 + [1693997405.995073][74683:74683] CHIP:DMG: Command handler moving to [CommandSen] + [1693997405.995076][74683:74683] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997405.995083][74683:74683] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997405.995086][74683:74683] CHIP:SVR: Failsafe timer expired + [1693997405.995090][74683:74683] CHIP:IN: SecureSession[0x5605c6bf5560]: MarkForEviction Type:1 LSID:41477 + [1693997405.995094][74683:74683] CHIP:SC: SecureSession[0x5605c6bf5560, LSID:41477]: State change 'kActive' --> 'kPendingEviction' + [1693997405.995109][74683:74683] CHIP:IN: SecureSession[0x5605c6bf5560]: Released - Type:1 LSID:41477 + [1693997405.995117][74683:74683] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997405.995133][74683:74683] CHIP:IN: SecureSession[0x5605c6bf5560]: Allocated Type:1 LSID:41479 + [1693997405.995138][74683:74683] CHIP:SC: Assigned local session key ID 41479 + [1693997405.995142][74683:74683] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 7: DAC Test Vector: Certificate Basic Constraint extension CA + field is wrong (TRUE for DAC and FALSE for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_ca_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997078.351251][74520:74520] CHIP:EM: <<< [E:37804r S:10760 M:65040301 (Ack:219159553)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997078.351258][74520:74520] CHIP:IN: (S) Sending msg 65040301 on secure session with LSID: 10760 + [1693997078.351302][74520:74520] CHIP:DMG: Command handler moving to [CommandSen] + [1693997078.351305][74520:74520] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997078.351311][74520:74520] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997078.351314][74520:74520] CHIP:SVR: Failsafe timer expired + [1693997078.351316][74520:74520] CHIP:IN: SecureSession[0x564ecf8d4890]: MarkForEviction Type:1 LSID:10760 + [1693997078.351319][74520:74520] CHIP:SC: SecureSession[0x564ecf8d4890, LSID:10760]: State change 'kActive' --> 'kPendingEviction' + [1693997078.351332][74520:74520] CHIP:IN: SecureSession[0x564ecf8d4890]: Released - Type:1 LSID:10760 + [1693997078.351340][74520:74520] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997078.351355][74520:74520] CHIP:IN: SecureSession[0x564ecf8d4890]: Allocated Type:1 LSID:10762 + [1693997078.351360][74520:74520] CHIP:SC: Assigned local session key ID 10762 + [1693997078.351363][74520:74520] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 8: CD Test Vector: The dac_origin_vendor_id and + dac_origin_product_id fields present and the VID value doesnt match + the VID found in the DAC Subject DN." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_pid_present_vid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994835.257566][73627:73627] CHIP:DMG: + [1693994835.257577][73627:73627] CHIP:EM: <<< [E:23698r S:38764 M:255686193 (Ack:187772892)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994835.257585][73627:73627] CHIP:IN: (S) Sending msg 255686193 on secure session with LSID: 38764 + [1693994835.257611][73627:73627] CHIP:DMG: Command handler moving to [CommandSen] + [1693994835.257614][73627:73627] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994835.257620][73627:73627] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994835.257623][73627:73627] CHIP:SVR: Failsafe timer expired + [1693994835.257627][73627:73627] CHIP:IN: SecureSession[0x559ec6387bb0]: MarkForEviction Type:1 LSID:38764 + [1693994835.257630][73627:73627] CHIP:SC: SecureSession[0x559ec6387bb0, LSID:38764]: State change 'kActive' --> 'kPendingEviction' + [1693994835.257648][73627:73627] CHIP:IN: SecureSession[0x559ec6387bb0]: Released - Type:1 LSID:38764 + [1693994835.257657][73627:73627] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994835.257675][73627:73627] CHIP:IN: SecureSession[0x559ec6387bb0]: Allocated Type:1 LSID:38766 + [1693994835.257680][73627:73627] CHIP:SC: Assigned local session key ID 38766 + [1693994835.257683][73627:73627] CHIP:SC: Waiting for PBKDF param request + [1693994835.257690][73627:73627] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 9: DAC Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mpid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_08/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995413.022547][73911:73911] CHIP:EM: <<< [E:30630r S:27734 M:175055120 (Ack:21253685)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995413.022553][73911:73911] CHIP:IN: (S) Sending msg 175055120 on secure session with LSID: 27734 + [1693995413.022574][73911:73911] CHIP:DMG: Command handler moving to [CommandSen] + [1693995413.022577][73911:73911] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995413.022582][73911:73911] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995413.022585][73911:73911] CHIP:SVR: Failsafe timer expired + [1693995413.022588][73911:73911] CHIP:IN: SecureSession[0x559867c24540]: MarkForEviction Type:1 LSID:27734 + [1693995413.022591][73911:73911] CHIP:SC: SecureSession[0x559867c24540, LSID:27734]: State change 'kActive' --> 'kPendingEviction' + [1693995413.022601][73911:73911] CHIP:IN: SecureSession[0x559867c24540]: Released - Type:1 LSID:27734 + [1693995413.022608][73911:73911] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995413.022623][73911:73911] CHIP:IN: SecureSession[0x559867c24540]: Allocated Type:1 LSID:27736 + [1693995413.022627][73911:73911] CHIP:SC: Assigned local session key ID 27736 + [1693995413.022630][73911:73911] CHIP:SC: Waiting for PBKDF param request + [1693995413.022635][73911:73911] CHIP:DIS: Updating services using commissioning mode 1 + [1693995413.022816][73911:73911] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995413.023022][73911:73911] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 10: CD Test Vector: Invalid CMS eContentType is set to Microsoft + Authenticode [MSAC] OID = { 1.3.6.1.4.1.311.2.1.4 }." + verification: | + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_econtent_type_msac/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996285.064401][74155:74155] CHIP:EM: <<< [E:19412r S:5515 M:218067074 (Ack:163851272)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996285.064410][74155:74155] CHIP:IN: (S) Sending msg 218067074 on secure session with LSID: 5515 + [1693996285.064463][74155:74155] CHIP:DMG: Command handler moving to [CommandSen] + [1693996285.064466][74155:74155] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996285.064475][74155:74155] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996285.064479][74155:74155] CHIP:SVR: Failsafe timer expired + [1693996285.064483][74155:74155] CHIP:IN: SecureSession[0x562b4607aae0]: MarkForEviction Type:1 LSID:5515 + [1693996285.064487][74155:74155] CHIP:SC: SecureSession[0x562b4607aae0, LSID:5515]: State change 'kActive' --> 'kPendingEviction' + [1693996285.064507][74155:74155] CHIP:IN: SecureSession[0x562b4607aae0]: Released - Type:1 LSID:5515 + [1693996285.064520][74155:74155] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996285.064543][74155:74155] CHIP:IN: SecureSession[0x562b4607aae0]: Allocated Type:1 LSID:5517 + [1693996285.064550][74155:74155] CHIP:SC: Assigned local session key ID 5517 + disabled: true + + - label: + "Step 11: PAI Test Vector: PID in Subject field doesnt match PID in + Issuer field" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_subject_pid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996330.239836][74189:74189] CHIP:DMG: + [1693996330.239846][74189:74189] CHIP:EM: <<< [E:61254r S:58699 M:113843948 (Ack:144549851)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996330.239854][74189:74189] CHIP:IN: (S) Sending msg 113843948 on secure session with LSID: 58699 + [1693996330.239877][74189:74189] CHIP:DMG: Command handler moving to [CommandSen] + [1693996330.239880][74189:74189] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996330.239885][74189:74189] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996330.239889][74189:74189] CHIP:SVR: Failsafe timer expired + [1693996330.239893][74189:74189] CHIP:IN: SecureSession[0x56184d3e2c40]: MarkForEviction Type:1 LSID:58699 + [1693996330.239897][74189:74189] CHIP:SC: SecureSession[0x56184d3e2c40, LSID:58699]: State change 'kActive' --> 'kPendingEviction' + [1693996330.239912][74189:74189] CHIP:IN: SecureSession[0x56184d3e2c40]: Released - Type:1 LSID:58699 + [1693996330.239922][74189:74189] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996330.239939][74189:74189] CHIP:IN: SecureSession[0x56184d3e2c40]: Allocated Type:1 LSID:58701 + [1693996330.239945][74189:74189] CHIP:SC: Assigned local session key ID 58701 + [1693996330.239950][74189:74189] CHIP:SC: Waiting for PBKDF param request + [1693996330.239956][74189:74189] CHIP:DIS: Updating services using commissioning mode 1 + [1693996330.240206][74189:74189] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693996330.240472][74189:74189] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 12: PAI Test Vector: Invalid certificate signature algorithm + ECDSA_WITH_SHA1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_sig_algo_ecdsa_with_sha1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993355.537189][72739:72739] CHIP:EM: <<< [E:46949r S:42353 M:75820384 (Ack:69095779)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993355.537196][72739:72739] CHIP:IN: (S) Sending msg 75820384 on secure session with LSID: 42353 + [1693993355.537235][72739:72739] CHIP:DMG: Command handler moving to [CommandSen] + [1693993355.537239][72739:72739] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993355.537245][72739:72739] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993355.537249][72739:72739] CHIP:SVR: Failsafe timer expired + [1693993355.537252][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: MarkForEviction Type:1 LSID:42353 + [1693993355.537256][72739:72739] CHIP:SC: SecureSession[0x561e088c6c60, LSID:42353]: State change 'kActive' --> 'kPendingEviction' + [1693993355.537273][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: Released - Type:1 LSID:42353 + [1693993355.537284][72739:72739] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993355.537303][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: Allocated Type:1 LSID:42355 + [1693993355.537308][72739:72739] CHIP:SC: Assigned local session key ID 42355 + [1693993355.537311][72739:72739] CHIP:SC: Waiting for PBKDF param request + [1693993355.537318][72739:72739] CHIP:DIS: Updating services using commissioning mode 1 + [1693993355.537588][72739:72739] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993355.537857][72739:72739] CHIP:DL: Using wifi MAC for hostname + [1693993355.537907][72739:72739] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693993355.537920][72739:72739] CHIP:DIS: Responding with _matterc._udp.local + [1693993355.537923][72739:72739] CHIP:DIS: Responding with 341D2ED7D15535D3._matterc._udp.local + disabled: true + + - label: + "Step 13: CD Test Vector: The product_id_array field has 10 PID values + none of which matches the PID value in DAC." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count10_mismatch/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform - ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 --paa-trust-store-path ~/connectedhomeip/credentials/development/attestation + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997271.340565][74610:74610] CHIP:EM: <<< [E:58667r S:59822 M:12912710 (Ack:254892351)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997271.340572][74610:74610] CHIP:IN: (S) Sending msg 12912710 on secure session with LSID: 59822 + [1693997271.340596][74610:74610] CHIP:DMG: Command handler moving to [CommandSen] + [1693997271.340599][74610:74610] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997271.340604][74610:74610] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997271.340608][74610:74610] CHIP:SVR: Failsafe timer expired + [1693997271.340610][74610:74610] CHIP:IN: SecureSession[0x56256eefc1b0]: MarkForEviction Type:1 LSID:59822 + [1693997271.340615][74610:74610] CHIP:SC: SecureSession[0x56256eefc1b0, LSID:59822]: State change 'kActive' --> 'kPendingEviction' + [1693997271.340627][74610:74610] CHIP:IN: SecureSession[0x56256eefc1b0]: Released - Type:1 LSID:59822 + [1693997271.340636][74610:74610] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997271.340650][74610:74610] CHIP:IN: SecureSession[0x56256eefc1b0]: Allocated Type:1 LSID:59824 + [1693997271.340655][74610:74610] CHIP:SC: Assigned local session key ID 59824 + [1693997271.340659][74610:74610] CHIP:SC: Waiting for PBKDF param request + [1693997271.340665][74610:74610] CHIP:DIS: Updating services using commissioning mode 1 + [1693997271.340877][74610:74610] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 14: DAC Test Vector: Invalid certificate public key curve + secp256k1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_sig_curve_secp256k1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994760.408266][73595:73595] CHIP:DMG: + [1693994760.408276][73595:73595] CHIP:EM: <<< [E:58926r S:22159 M:71363476 (Ack:241325210)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994760.408282][73595:73595] CHIP:IN: (S) Sending msg 71363476 on secure session with LSID: 22159 + [1693994760.408309][73595:73595] CHIP:DMG: Command handler moving to [CommandSen] + [1693994760.408312][73595:73595] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994760.408318][73595:73595] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994760.408321][73595:73595] CHIP:SVR: Failsafe timer expired + [1693994760.408324][73595:73595] CHIP:IN: SecureSession[0x55f597d52960]: MarkForEviction Type:1 LSID:22159 + [1693994760.408328][73595:73595] CHIP:SC: SecureSession[0x55f597d52960, LSID:22159]: State change 'kActive' --> 'kPendingEviction' + [1693994760.408344][73595:73595] CHIP:IN: SecureSession[0x55f597d52960]: Released - Type:1 LSID:22159 + [1693994760.408351][73595:73595] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994760.408367][73595:73595] CHIP:IN: SecureSession[0x55f597d52960]: Allocated Type:1 LSID:22161 + [1693994760.408372][73595:73595] CHIP:SC: Assigned local session key ID 22161 + [1693994760.408375][73595:73595] CHIP:SC: Waiting for PBKDF param request + [1693994760.408382][73595:73595] CHIP:DIS: Updating services using commissioning mode 1 + [1693994760.408655][73595:73595] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994760.408910][73595:73595] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 15: DAC Test Vector: Certificate Key Usage extension critical + field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_key_usage_critical_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997054.992158][74509:74509] CHIP:EM: <<< [E:37779r S:15307 M:202831458 (Ack:181316818)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997054.992164][74509:74509] CHIP:IN: (S) Sending msg 202831458 on secure session with LSID: 15307 + [1693997054.992205][74509:74509] CHIP:DMG: Command handler moving to [CommandSen] + [1693997054.992208][74509:74509] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997054.992214][74509:74509] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997054.992217][74509:74509] CHIP:SVR: Failsafe timer expired + [1693997054.992220][74509:74509] CHIP:IN: SecureSession[0x563fed359aa0]: MarkForEviction Type:1 LSID:15307 + [1693997054.992223][74509:74509] CHIP:SC: SecureSession[0x563fed359aa0, LSID:15307]: State change 'kActive' --> 'kPendingEviction' + [1693997054.992237][74509:74509] CHIP:IN: SecureSession[0x563fed359aa0]: Released - Type:1 LSID:15307 + [1693997054.992246][74509:74509] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997054.992264][74509:74509] CHIP:IN: SecureSession[0x563fed359aa0]: Allocated Type:1 LSID:15309 + [1693997054.992269][74509:74509] CHIP:SC: Assigned local session key ID 15309 + [1693997054.992272][74509:74509] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 16: DAC Test Vector: Certificate doesnt include Subject Key ID + (SKID) extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_skid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997101.085189][74532:74532] CHIP:EM: <<< [E:980r S:47787 M:224476482 (Ack:52007145)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997101.085195][74532:74532] CHIP:IN: (S) Sending msg 224476482 on secure session with LSID: 47787 + [1693997101.085220][74532:74532] CHIP:DMG: Command handler moving to [CommandSen] + [1693997101.085223][74532:74532] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997101.085228][74532:74532] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997101.085230][74532:74532] CHIP:SVR: Failsafe timer expired + [1693997101.085233][74532:74532] CHIP:IN: SecureSession[0x56202f5eeaf0]: MarkForEviction Type:1 LSID:47787 + [1693997101.085236][74532:74532] CHIP:SC: SecureSession[0x56202f5eeaf0, LSID:47787]: State change 'kActive' --> 'kPendingEviction' + [1693997101.085248][74532:74532] CHIP:IN: SecureSession[0x56202f5eeaf0]: Released - Type:1 LSID:47787 + [1693997101.085255][74532:74532] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997101.085269][74532:74532] CHIP:IN: SecureSession[0x56202f5eeaf0]: Allocated Type:1 LSID:47789 + [1693997101.085274][74532:74532] CHIP:SC: Assigned local session key ID 47789 + [1693997101.085276][74532:74532] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: "Step 17: CD Test Vector: Invalid Signer Info version set to v2." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_signer_info_v2/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993317.367258][72717:72717] CHIP:EM: <<< [E:12718r S:18565 M:251356398 (Ack:239317917)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993317.367267][72717:72717] CHIP:IN: (S) Sending msg 251356398 on secure session with LSID: 18565 + [1693993317.367312][72717:72717] CHIP:DMG: Command handler moving to [CommandSen] + [1693993317.367318][72717:72717] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993317.367326][72717:72717] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993317.367331][72717:72717] CHIP:SVR: Failsafe timer expired + [1693993317.367334][72717:72717] CHIP:IN: SecureSession[0x55a97361eb30]: MarkForEviction Type:1 LSID:18565 + [1693993317.367340][72717:72717] CHIP:SC: SecureSession[0x55a97361eb30, LSID:18565]: State change 'kActive' --> 'kPendingEviction' + [1693993317.367359][72717:72717] CHIP:IN: SecureSession[0x55a97361eb30]: Released - Type:1 LSID:18565 + [1693993317.367370][72717:72717] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993317.367391][72717:72717] CHIP:IN: SecureSession[0x55a97361eb30]: Allocated Type:1 LSID:18567 + [1693993317.367396][72717:72717] CHIP:SC: Assigned local session key ID 18567 + [1693993317.367400][72717:72717] CHIP:SC: Waiting for PBKDF param request + [1693993317.367406][72717:72717] CHIP:DIS: Updating services using commissioning mode 1 + [1693993317.367652][72717:72717] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993317.367956][72717:72717] CHIP:DL: Using wifi MAC for hostname + [1693993317.368007][72717:72717] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 18: DAC Test Vector: Certificate Key Usage extension + digitalSignature field is wrong (not present for DAC and present for + PAI, which is OK as optional)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_key_usage_dig_sig_wrong/test_case_vector.json --product-id 32768 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1662455580.725445][31980:31985] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0001 - [1662455580.725450][31980:31985] CHIP:CTL: Received Attestation Information from the device - [1662455580.725454][31980:31985] CHIP:CTL: Successfully finished commissioning step 'SendAttestationRequest' - [1662455580.725461][31980:31985] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1662455580.725465][31980:31985] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1662455580.725468][31980:31985] CHIP:CTL: Verifying attestation - [1662455580.725944][31980:31985] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 101. Look at AttestationVerificationResult enum to understand the errors - [1662455580.725956][31980:31985] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' - [1662455580.725958][31980:31985] CHIP:CTL: Failed to perform commissioning step 8 - [1662455580.725961][31980:31985] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1662455580.725966][31980:31985] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' - [1662455580.725979][31980:31985] CHIP:CTL: Expiring failsafe on proxy 0x7fe3b40236a0 + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996261.937664][74143:74143] CHIP:EM: <<< [E:4439r S:62297 M:255923001 (Ack:4405626)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996261.937674][74143:74143] CHIP:IN: (S) Sending msg 255923001 on secure session with LSID: 62297 + [1693996261.937736][74143:74143] CHIP:DMG: Command handler moving to [CommandSen] + [1693996261.937742][74143:74143] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996261.937750][74143:74143] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996261.937755][74143:74143] CHIP:SVR: Failsafe timer expired + [1693996261.937758][74143:74143] CHIP:IN: SecureSession[0x55c35e92eea0]: MarkForEviction Type:1 LSID:62297 + [1693996261.937761][74143:74143] CHIP:SC: SecureSession[0x55c35e92eea0, LSID:62297]: State change 'kActive' --> 'kPendingEviction' + [1693996261.937779][74143:74143] CHIP:IN: SecureSession[0x55c35e92eea0]: Released - Type:1 LSID:62297 + [1693996261.937788][74143:74143] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996261.937808][74143:74143] CHIP:IN: SecureSession[0x55c35e92eea0]: Allocated Type:1 LSID:62299 + [1693996261.937814][74143:74143] CHIP:SC: Assigned local session key ID 62299 + [1693996261.937816][74143:74143] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 19: DAC Test Vector: Certificate doesnt include Authority Key ID + (AKID) extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_akid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995381.552754][73894:73894] CHIP:DMG: + [1693995381.552761][73894:73894] CHIP:EM: <<< [E:37229r S:55064 M:5606557 (Ack:201777288)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995381.552767][73894:73894] CHIP:IN: (S) Sending msg 5606557 on secure session with LSID: 55064 + [1693995381.552789][73894:73894] CHIP:DMG: Command handler moving to [CommandSen] + [1693995381.552792][73894:73894] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995381.552796][73894:73894] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995381.552799][73894:73894] CHIP:SVR: Failsafe timer expired + [1693995381.552802][73894:73894] CHIP:IN: SecureSession[0x563b61004960]: MarkForEviction Type:1 LSID:55064 + [1693995381.552804][73894:73894] CHIP:SC: SecureSession[0x563b61004960, LSID:55064]: State change 'kActive' --> 'kPendingEviction' + [1693995381.552815][73894:73894] CHIP:IN: SecureSession[0x563b61004960]: Released - Type:1 LSID:55064 + [1693995381.552823][73894:73894] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995381.552836][73894:73894] CHIP:IN: SecureSession[0x563b61004960]: Allocated Type:1 LSID:55066 + [1693995381.552840][73894:73894] CHIP:SC: Assigned local session key ID 55066 + [1693995381.552843][73894:73894] CHIP:SC: Waiting for PBKDF param request + [1693995381.552848][73894:73894] CHIP:DIS: Updating services using commissioning mode 1 + [1693995381.553045][73894:73894] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995381.553265][73894:73894] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 20: PAI Test Vector: Certificate doesnt include Basic Constraint + extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_missing/test_case_vector.json --product-id 32768 - 2. To Execute this step for error condition 2 Commissionee provides an invalid DAC and PAI chain , follow the below steps, + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - All sample error scenario certificates has generated and present in ~/connectedhomeip/credentials/development/commissioner_dut/ + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994276.553200][73374:73374] CHIP:DMG: peer_address = UDP:[fe80::a70c:61dc:df51:6945%enxd03745ce8f62]:36473 + [1693994276.553203][73374:73374] CHIP:DMG: } + [1693994276.553206][73374:73374] CHIP:DMG: + [1693994276.553217][73374:73374] CHIP:EM: <<< [E:65206r S:34371 M:72339643 (Ack:58486237)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994276.553225][73374:73374] CHIP:IN: (S) Sending msg 72339643 on secure session with LSID: 34371 + [1693994276.553250][73374:73374] CHIP:DMG: Command handler moving to [CommandSen] + [1693994276.553254][73374:73374] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994276.553259][73374:73374] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994276.553262][73374:73374] CHIP:SVR: Failsafe timer expired + [1693994276.553265][73374:73374] CHIP:IN: SecureSession[0x5604c97909b0]: MarkForEviction Type:1 LSID:34371 + [1693994276.553269][73374:73374] CHIP:SC: SecureSession[0x5604c97909b0, LSID:34371]: State change 'kActive' --> 'kPendingEviction' + [1693994276.553285][73374:73374] CHIP:IN: SecureSession[0x5604c97909b0]: Released - Type:1 LSID:34371 + [1693994276.553295][73374:73374] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994276.553313][73374:73374] CHIP:IN: SecureSession[0x5604c97909b0]: Allocated Type:1 LSID:34373 + [1693994276.553319][73374:73374] CHIP:SC: Assigned local session key ID 34373 + [1693994276.553323][73374:73374] CHIP:SC: Waiting for PBKDF param request + [1693994276.553330][73374:73374] CHIP:DIS: Updating services using commissioning mode 1 + [1693994276.553580][73374:73374] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994276.553870][73374:73374] CHIP:DL: Using wifi MAC for hostname + [1693994276.553912][73374:73374] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994276.553924][73374:73374] CHIP:DIS: Responding with _matterc._udp.local + disabled: true - Commissionee provides an invalid DAC and PAI - Use the folder - connectedhomeip/credentials/development/commissioner_dut/struct_dac_sig_algo_ecdsa_with_sha1 & use the sample json test_case_vector.json + - label: + "Step 21: CD Test Vector: The security_information field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_dac_sig_algo_ecdsa_with_sha1/test_case_vector.json + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_security_info_missing/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1684494307.862989][176412:176414] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1684494307.862994][176412:176414] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1684494307.862996][176412:176414] CHIP:CTL: Verifying attestation - [1684494307.864806][176412:176414] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 303. Look at AttestationVerificationResult enum to understand the errors - [1684494307.864822][176412:176414] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684494307.864826][176412:176414] CHIP:CTL: Failed to perform commissioning step 8 - [1684494307.864829][176412:176414] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1684494307.864837][176412:176414] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684494307.864844][176412:176414] CHIP:CTL: Expiring failsafe on proxy 0x7f2308036bd0 - [1684494307.864860][176412:176414] CHIP:DMG: ICR moving to [AddingComm] - [1684494307.864865][176412:176414] CHIP:DMG: ICR moving to [AddedComma] - [1684494307.864945][176412:176414] CHIP:EM: <<< [E:6835i M:18286748] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest) + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996239.759850][74133:74133] CHIP:EM: <<< [E:11884r S:63423 M:74553917 (Ack:204682393)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996239.759857][74133:74133] CHIP:IN: (S) Sending msg 74553917 on secure session with LSID: 63423 + [1693996239.759887][74133:74133] CHIP:DMG: Command handler moving to [CommandSen] + [1693996239.759890][74133:74133] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996239.759897][74133:74133] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996239.759900][74133:74133] CHIP:SVR: Failsafe timer expired + [1693996239.759904][74133:74133] CHIP:IN: SecureSession[0x557fa61c3c90]: MarkForEviction Type:1 LSID:63423 + [1693996239.759908][74133:74133] CHIP:SC: SecureSession[0x557fa61c3c90, LSID:63423]: State change 'kActive' --> 'kPendingEviction' + [1693996239.759923][74133:74133] CHIP:IN: SecureSession[0x557fa61c3c90]: Released - Type:1 LSID:63423 + [1693996239.759932][74133:74133] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996239.759948][74133:74133] CHIP:IN: SecureSession[0x557fa61c3c90]: Allocated Type:1 LSID:63425 + [1693996239.759953][74133:74133] CHIP:SC: Assigned local session key ID 63425 + [1693996239.759956][74133:74133] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 22: PAI Test Vector: Certificate Key Usage extension keyCertSign + field is wrong (present for DAC and not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_key_cert_sign_wrong/test_case_vector.json --product-id 32768 + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997515.751436][74733:74733] CHIP:DMG: + [1693997515.751444][74733:74733] CHIP:EM: <<< [E:5171r S:65366 M:88404245 (Ack:115426625)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997515.751449][74733:74733] CHIP:IN: (S) Sending msg 88404245 on secure session with LSID: 65366 + [1693997515.751471][74733:74733] CHIP:DMG: Command handler moving to [CommandSen] + [1693997515.751474][74733:74733] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997515.751481][74733:74733] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997515.751484][74733:74733] CHIP:SVR: Failsafe timer expired + [1693997515.751487][74733:74733] CHIP:IN: SecureSession[0x558c6a10d970]: MarkForEviction Type:1 LSID:65366 + [1693997515.751491][74733:74733] CHIP:SC: SecureSession[0x558c6a10d970, LSID:65366]: State change 'kActive' --> 'kPendingEviction' + [1693997515.751505][74733:74733] CHIP:IN: SecureSession[0x558c6a10d970]: Released - Type:1 LSID:65366 + [1693997515.751513][74733:74733] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997515.751528][74733:74733] CHIP:IN: SecureSession[0x558c6a10d970]: Allocated Type:1 LSID:65368 + [1693997515.751533][74733:74733] CHIP:SC: Assigned local session key ID 65368 + [1693997515.751536][74733:74733] CHIP:SC: Waiting for PBKDF param request + disabled: true + - label: + "Step 23: CD Test Vector: The authorized_paa_list contains one valid + PAA which is authorized to sign the PAI." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count0/test_case_vector.json --product-id 32768 - 3. Similarly for condition 3 Commissionee provides DAC with validity period that is not in range of PAA/PAI follow below steps + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - Commissionee provides DAC with validity period that is not in range of PAA/PAI - Use the folder - connectedhomeip/credentials/development/commissioner_dut/struct_dac_valid_in_past & use the sample json test_case_vector.json + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994866.084220][73646:73646] CHIP:EM: <<< [E:32023r S:4683 M:260375300 (Ack:133194635)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994866.084225][73646:73646] CHIP:IN: (S) Sending msg 260375300 on secure session with LSID: 4683 + [1693994866.084267][73646:73646] CHIP:DMG: Command handler moving to [CommandSen] + [1693994866.084269][73646:73646] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994866.084274][73646:73646] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994866.084276][73646:73646] CHIP:SVR: Failsafe timer expired + [1693994866.084279][73646:73646] CHIP:IN: SecureSession[0x564174dd8940]: MarkForEviction Type:1 LSID:4683 + [1693994866.084282][73646:73646] CHIP:SC: SecureSession[0x564174dd8940, LSID:4683]: State change 'kActive' --> 'kPendingEviction' + [1693994866.084294][73646:73646] CHIP:IN: SecureSession[0x564174dd8940]: Released - Type:1 LSID:4683 + [1693994866.084300][73646:73646] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994866.084314][73646:73646] CHIP:IN: SecureSession[0x564174dd8940]: Allocated Type:1 LSID:4685 + [1693994866.084319][73646:73646] CHIP:SC: Assigned local session key ID 4685 + [1693994866.084321][73646:73646] CHIP:SC: Waiting for PBKDF param request + [1693994866.084326][73646:73646] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true - Commission TH to DUT by using --dac_provider parameter + - label: + "Step 24: CD Test Vector: The product_id_array field is empty TLV + array." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_dac_valid_in_past/test_case_vector.json + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count01_mismatch/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994601.641020][73535:73535] CHIP:EM: <<< [E:59651r S:16286 M:42317111 (Ack:165156221)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994601.641028][73535:73535] CHIP:IN: (S) Sending msg 42317111 on secure session with LSID: 16286 + [1693994601.641053][73535:73535] CHIP:DMG: Command handler moving to [CommandSen] + [1693994601.641057][73535:73535] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994601.641064][73535:73535] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994601.641067][73535:73535] CHIP:SVR: Failsafe timer expired + [1693994601.641071][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: MarkForEviction Type:1 LSID:16286 + [1693994601.641075][73535:73535] CHIP:SC: SecureSession[0x558132a3cae0, LSID:16286]: State change 'kActive' --> 'kPendingEviction' + [1693994601.641091][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: Released - Type:1 LSID:16286 + [1693994601.641101][73535:73535] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994601.641116][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: Allocated Type:1 LSID:16288 + [1693994601.641122][73535:73535] CHIP:SC: Assigned local session key ID 16288 + [1693994601.641126][73535:73535] CHIP:SC: Waiting for PBKDF param request + [1693994601.641134][73535:73535] CHIP:DIS: Updating services using commissioning mode 1 + [1693994601.641380][73535:73535] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994601.641631][73535:73535] CHIP:DL: Using wifi MAC for hostname + [1693994601.641667][73535:73535] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994601.641679][73535:73535] CHIP:DIS: Responding with _matterc._udp.local + disabled: true + + - label: + "Step 25: CD Test Vector: The vendor_id field doesnt match the VID in + DAC." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_vid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1684494415.854066][176461:176463] CHIP:CTL: Received Attestation Information from the device - [1684494415.854069][176461:176463] CHIP:CTL: Successfully finished commissioning step 'SendAttestationRequest' - [1684494415.854072][176461:176463] CHIP:CTL: AutoCommissioner setting attestationElements buffer size 278/278 - [1684494415.854080][176461:176463] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1684494415.854085][176461:176463] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1684494415.854088][176461:176463] CHIP:CTL: Verifying attestation - [1684494415.860949][176461:176463] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 300. Look at AttestationVerificationResult enum to understand the errors - [1684494415.860970][176461:176463] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684494415.860974][176461:176463] CHIP:CTL: Failed to perform commissioning step 8 - [1684494415.860978][176461:176463] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1684494415.860990][176461:176463] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684494415.860994][176461:176463] CHIP:CTL: Expiring failsafe on proxy 0x7f617c036bd0 + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994486.893297][73502:73502] CHIP:DMG: + [1693994486.893313][73502:73502] CHIP:EM: <<< [E:21518r S:20806 M:104253722 (Ack:147833640)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994486.893323][73502:73502] CHIP:IN: (S) Sending msg 104253722 on secure session with LSID: 20806 + [1693994486.893367][73502:73502] CHIP:DMG: Command handler moving to [CommandSen] + [1693994486.893372][73502:73502] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994486.893379][73502:73502] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994486.893384][73502:73502] CHIP:SVR: Failsafe timer expired + [1693994486.893388][73502:73502] CHIP:IN: SecureSession[0x561bb3613ad0]: MarkForEviction Type:1 LSID:20806 + [1693994486.893393][73502:73502] CHIP:SC: SecureSession[0x561bb3613ad0, LSID:20806]: State change 'kActive' --> 'kPendingEviction' + [1693994486.893411][73502:73502] CHIP:IN: SecureSession[0x561bb3613ad0]: Released - Type:1 LSID:20806 + [1693994486.893421][73502:73502] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994486.893442][73502:73502] CHIP:IN: SecureSession[0x561bb3613ad0]: Allocated Type:1 LSID:20808 + [1693994486.893449][73502:73502] CHIP:SC: Assigned local session key ID 20808 + [1693994486.893453][73502:73502] CHIP:SC: Waiting for PBKDF param request + [1693994486.893460][73502:73502] CHIP:DIS: Updating services using commissioning mode 1 + [1693994486.893767][73502:73502] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994486.894023][73502:73502] CHIP:DL: Using wifi MAC for hostname + [1693994486.894053][73502:73502] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 disabled: true - label: - "Step 8: Repeat step 1 to step 7 and for step 5 set different error - condition: Certification Declaration has only one of the following - fields dac_origin_vendor_id dac_origin_product_id vendor_id field in - the Certification Declaration does not match with the VendorID - attribute found in the Basic Information cluster The Vendor ID in the - DAC does not match the vendor_id field in the Certification - Declaration. The Product ID (PID) the DAC is not present in the - product_id_array field in the Certification Declaration" + "Step 26: DAC Test Vector: Certificate Basic Constraint extension + PathLen field set to 2" verification: | - For each error scenario Factory reset on TH1(all-clusters-app) as explained in step 6 + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset - 1. To Execute ths step for error condition 1 Certification Declaration has only one of the following fields dac_origin_vendor_id dac_origin_product_id follow the below steps - All sample error scenario certificate has generated and presented in ~/connectedhomeip/credentials/development/commissioner_dut/ - Use the appropriate folder to test different scenarios. + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_missing_pid_present/test_case_vector.json + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_pathlen2/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1662459904.540345][32873:32878] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0001 - [1662459904.540349][32873:32878] CHIP:CTL: Received Attestation Information from the device - [1662459904.540352][32873:32878] CHIP:CTL: Successfully finished commissioning step 'SendAttestationRequest' - [1662459904.540358][32873:32878] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1662459904.540361][32873:32878] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1662459904.540363][32873:32878] CHIP:CTL: Verifying attestation - [1662459904.541210][32873:32878] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 603. Look at AttestationVerificationResult enum to understand the errors - [1662459904.541219][32873:32878] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' - [1662459904.541221][32873:32878] CHIP:CTL: Failed to perform commissioning step 8 - [1662459904.541223][32873:32878] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1662459904.541229][32873:32878] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1027: CHIP Error 0x000000AC: Internal error' - [1662459904.541231][32873:32878] CHIP:CTL: Expiring failsafe on proxy 0x7f1b8c023460 - [1662459904.541240][32873:32878] CHIP:DMG: ICR moving to [AddingComm] - [1662459904.541244][32873:32878] CHIP:DMG: ICR moving to [AddedComma] - [1662459904.541289][32873:32878] CHIP:IN: Prepared secure message 0x7f1b8c02d208 to 0xFFFFFFFB00000000 (0) of type 0x8 and protocolId (0, 1) on exchange 3056i with MessageCounter:44223388. - [1662459904.541294][32873:32878] CHIP:IN: Sending encrypted msg 0x7f1b8c02d208 with MessageCounter:44223388 to 0xFFFFFFFB00000000 (0) at monotonic time: 0000000003C6523D msec - [1662459904.541346][32873:32878] CHIP:DMG: >> to UDP:[fe80::b7b8:ff3e:9ace:3e12%wlp0s20f3]:5540 | 44223388 | [Interaction Model (1) / InvokeCommandRequest (0x08) / Session = 16788 / Exchange = 3056] + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996848.934331][74418:74418] CHIP:DMG: + [1693996848.934341][74418:74418] CHIP:EM: <<< [E:42022r S:36447 M:202045280 (Ack:89005990)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996848.934346][74418:74418] CHIP:IN: (S) Sending msg 202045280 on secure session with LSID: 36447 + [1693996848.934373][74418:74418] CHIP:DMG: Command handler moving to [CommandSen] + [1693996848.934376][74418:74418] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996848.934380][74418:74418] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996848.934383][74418:74418] CHIP:SVR: Failsafe timer expired + [1693996848.934385][74418:74418] CHIP:IN: SecureSession[0x559fea0e1c60]: MarkForEviction Type:1 LSID:36447 + [1693996848.934398][74418:74418] CHIP:SC: SecureSession[0x559fea0e1c60, LSID:36447]: State change 'kActive' --> 'kPendingEviction' + [1693996848.934413][74418:74418] CHIP:IN: SecureSession[0x559fea0e1c60]: Released - Type:1 LSID:36447 + [1693996848.934421][74418:74418] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + disabled: true + + - label: + "Step 27: PAI Test Vector: Certificate Key Usage extension cRLSign + field is wrong (present for DAC and not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_crl_sign_wrong/test_case_vector.json --product-id 32768 + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - 2. Similarly for 2nd error condition i.e. vendor_id field in the Certification Declaration does not match with the VendorID attribute found in the Basic Information cluster , follow the below steps + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995732.022364][73958:73958] CHIP:EM: <<< [E:45133r S:28926 M:139363549 (Ack:191197291)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995732.022372][73958:73958] CHIP:IN: (S) Sending msg 139363549 on secure session with LSID: 28926 + [1693995732.022397][73958:73958] CHIP:DMG: Command handler moving to [CommandSen] + [1693995732.022400][73958:73958] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995732.022406][73958:73958] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995732.022409][73958:73958] CHIP:SVR: Failsafe timer expired + [1693995732.022412][73958:73958] CHIP:IN: SecureSession[0x5637ef6d5990]: MarkForEviction Type:1 LSID:28926 + [1693995732.022416][73958:73958] CHIP:SC: SecureSession[0x5637ef6d5990, LSID:28926]: State change 'kActive' --> 'kPendingEviction' + [1693995732.022432][73958:73958] CHIP:IN: SecureSession[0x5637ef6d5990]: Released - Type:1 LSID:28926 + [1693995732.022442][73958:73958] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995732.022459][73958:73958] CHIP:IN: SecureSession[0x5637ef6d5990]: Allocated Type:1 LSID:28928 + [1693995732.022465][73958:73958] CHIP:SC: Assigned local session key ID 28928 + [1693995732.022469][73958:73958] CHIP:SC: Waiting for PBKDF param request + [1693995732.022476][73958:73958] CHIP:DIS: Updating services using commissioning mode 1 + [1693995732.022723][73958:73958] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995732.023005][73958:73958] CHIP:DL: Using wifi MAC for hostname + [1693995732.023042][73958:73958] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true - All sample error scenario certificate has generated and present in ~/connectedhomeip/credentials/development/commissioner_dut/ - Use the appropriate folder to test different scenario. + - label: + "Step 28: CD Test Vector: Invalid Signer Info digest algorithm SHA1." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset - vendor_id field in the Certification Declaration does not match with the VendorID attribute found in the Basic Information cluster - connectedhomeip/credentials/development/commissioner_dut/struct_cd_vid_mismatch - & use the sample json test_case_vector.json + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_cd_vid_mismatch/test_case_vector.json + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_signer_info_digest_algo_sha1/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1684495876.434738][176910:176912] CHIP:DMG: }, - [1684495876.434750][176910:176912] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0001 - [1684495876.434754][176910:176912] CHIP:CTL: Received Attestation Information from the device - [1684495876.434758][176910:176912] CHIP:CTL: Successfully finished commissioning step 'SendAttestationRequest' - [1684495876.434761][176910:176912] CHIP:CTL: AutoCommissioner setting attestationElements buffer size 278/278 - [1684495876.434768][176910:176912] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1684495876.434772][176910:176912] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1684495876.434774][176910:176912] CHIP:CTL: Verifying attestation - [1684495876.441867][176910:176912] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 604. Look at AttestationVerificationResult enum to understand the errors - [1684495876.441878][176910:176912] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684495876.441881][176910:176912] CHIP:CTL: Failed to perform commissioning step 8 - [1684495876.441885][176910:176912] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1684495876.441891][176910:176912] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684495876.441894][176910:176912] CHIP:CTL: Expiring failsafe on proxy 0x7f1fc0036bd0 - [1684495876.441907][176910:176912] CHIP:DMG: ICR moving to [AddingComm] - [1684495876.441912][176910:176912] CHIP:DMG: ICR moving to [AddedComma] - [1684495876.441967][176910:176912] CHIP:EM: <<< [E:25914i M:173255705] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest) - [1684495876.441973][176910:176912] CHIP:IN: (S) Sending msg 173255705 on secure session with LSID: 21068 - [1684495876.442029][176910:176912] CHIP:DMG: >> to UDP:[fe80::529f:9f59:cfec:7130%wlp0s20f3]:5540 | 173255705 | [Interaction Model (1) / InvokeCommandRequest + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994367.331030][73424:73424] CHIP:EM: <<< [E:34584r S:41358 M:224843539 (Ack:179898907)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994367.331036][73424:73424] CHIP:IN: (S) Sending msg 224843539 on secure session with LSID: 41358 + [1693994367.331059][73424:73424] CHIP:DMG: Command handler moving to [CommandSen] + [1693994367.331062][73424:73424] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994367.331067][73424:73424] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994367.331070][73424:73424] CHIP:SVR: Failsafe timer expired + [1693994367.331073][73424:73424] CHIP:IN: SecureSession[0x55c991abec90]: MarkForEviction Type:1 LSID:41358 + [1693994367.331079][73424:73424] CHIP:SC: SecureSession[0x55c991abec90, LSID:41358]: State change 'kActive' --> 'kPendingEviction' + [1693994367.331090][73424:73424] CHIP:IN: SecureSession[0x55c991abec90]: Released - Type:1 LSID:41358 + [1693994367.331097][73424:73424] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994367.331111][73424:73424] CHIP:IN: SecureSession[0x55c991abec90]: Allocated Type:1 LSID:41360 + [1693994367.331116][73424:73424] CHIP:SC: Assigned local session key ID 41360 + [1693994367.331118][73424:73424] CHIP:SC: Waiting for PBKDF param request + [1693994367.331124][73424:73424] CHIP:DIS: Updating services using commissioning mode 1 + [1693994367.331310][73424:73424] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994367.331527][73424:73424] CHIP:DL: Using wifi MAC for hostname + [1693994367.331559][73424:73424] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994367.331568][73424:73424] CHIP:DIS: Responding with _matterc._udp.local + [1693994367.331572][73424:73424] CHIP:DIS: Responding with D90EF381193D21EB._matterc._udp.loc + disabled: true + + - label: + "Step 29: PAI Test Vector: Fallback VID and PID encoding example: + invalid VID encoding" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_10/test_case_vector.json --product-id 177 - 3. Similary for 3rd error condition follow the below steps - All sample error scenario certificate has generated and present in ~/connectedhomeip/credentials/development/commissioner_dut/ - Use the appropriate folder to test different scenario. + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997239.698633][74597:74597] CHIP:EM: <<< [E:5732r S:61163 M:138027290 (Ack:110202572)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997239.698640][74597:74597] CHIP:IN: (S) Sending msg 138027290 on secure session with LSID: 61163 + [1693997239.698700][74597:74597] CHIP:DMG: Command handler moving to [CommandSen] + [1693997239.698706][74597:74597] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997239.698716][74597:74597] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997239.698723][74597:74597] CHIP:SVR: Failsafe timer expired + [1693997239.698727][74597:74597] CHIP:IN: SecureSession[0x55d7d8191960]: MarkForEviction Type:1 LSID:61163 + [1693997239.698734][74597:74597] CHIP:SC: SecureSession[0x55d7d8191960, LSID:61163]: State change 'kActive' --> 'kPendingEviction' + [1693997239.698761][74597:74597] CHIP:IN: SecureSession[0x55d7d8191960]: Released - Type:1 LSID:61163 + [1693997239.698781][74597:74597] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997239.698830][74597:74597] CHIP:IN: SecureSession[0x55d7d8191960]: Allocated Type:1 LSID:61165 + [1693997239.698841][74597:74597] CHIP:SC: Assigned local session key ID 61165 + [1693997239.698848][74597:74597] CHIP:SC: Waiting for PBKDF param request + [1693997239.698862][74597:74597] CHIP:DIS: Updating services using commissioning mode 1 + [1693997239.699249][74597:74597] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true - vendor_id field in the Certification Declaration does not match with the VendorID attribute found in the Basic Information cluster - connectedhomeip/credentials/development/commissioner_dut/struct_cd_vid_mismatch - & use the sample json test_case_vector.json + - label: + "Step 30: PAI Test Vector: Certificate Basic Constraint extension + critical field is set as 'non-critical'" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_cd_vid_mismatch/test_case_vector.json + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_critical_wrong/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1684495930.801406][176931:176933] CHIP:CTL: Received Attestation Information from the device - [1684495930.801409][176931:176933] CHIP:CTL: Successfully finished commissioning step 'SendAttestationRequest' - [1684495930.801411][176931:176933] CHIP:CTL: AutoCommissioner setting attestationElements buffer size 278/278 - [1684495930.801417][176931:176933] CHIP:CTL: Commissioning stage next step: 'SendAttestationRequest' -> 'AttestationVerification' - [1684495930.801420][176931:176933] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1684495930.801421][176931:176933] CHIP:CTL: Verifying attestation - [1684495930.808506][176931:176933] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 604. Look at AttestationVerificationResult enum to understand the errors - [1684495930.808521][176931:176933] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684495930.808524][176931:176933] CHIP:CTL: Failed to perform commissioning step 8 - [1684495930.808526][176931:176933] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1684495930.808533][176931:176933] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684495930.808535][176931:176933] CHIP:CTL: Expiring failsafe on proxy 0x7fc730036bd0 - [1684495930.808548][176931:176933] CHIP:DMG: ICR moving to [AddingComm] - [1684495930.808551][176931:176933] CHIP:DMG: ICR moving to [AddedComma] - [1684495930.808609][176931:176933] CHIP:EM: <<< [E:8667i M:71525087] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest) - [1684495930.808614][176931:176933] CHIP:IN: (S) Sending msg 71525087 on secure session with LSID: 21274 + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995285.889838][73846:73846] CHIP:EM: <<< [E:45422r S:62769 M:160526158 (Ack:96854025)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995285.889844][73846:73846] CHIP:IN: (S) Sending msg 160526158 on secure session with LSID: 62769 + [1693995285.889866][73846:73846] CHIP:DMG: Command handler moving to [CommandSen] + [1693995285.889870][73846:73846] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995285.889876][73846:73846] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995285.889880][73846:73846] CHIP:SVR: Failsafe timer expired + [1693995285.889883][73846:73846] CHIP:IN: SecureSession[0x564a0507ca40]: MarkForEviction Type:1 LSID:62769 + [1693995285.889887][73846:73846] CHIP:SC: SecureSession[0x564a0507ca40, LSID:62769]: State change 'kActive' --> 'kPendingEviction' + [1693995285.889904][73846:73846] CHIP:IN: SecureSession[0x564a0507ca40]: Released - Type:1 LSID:62769 + [1693995285.889913][73846:73846] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995285.889932][73846:73846] CHIP:IN: SecureSession[0x564a0507ca40]: Allocated Type:1 LSID:62771 + [1693995285.889938][73846:73846] CHIP:SC: Assigned local session key ID 62771 + [1693995285.889941][73846:73846] CHIP:SC: Waiting for PBKDF param request + [1693995285.889948][73846:73846] CHIP:DIS: Updating services using commissioning mode 1 + [1693995285.890194][73846:73846] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995285.890476][73846:73846] CHIP:DL: Using wifi MAC for hostname + [1693995285.890515][73846:73846] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 31: DAC Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mvid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_07/test_case_vector.json --product-id 177 - 4. Similary for 4th error condition follow the below steps + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - All sample error scenario certificate has generated and present in ~/connectedhomeip/credentials/development/commissioner_dut/ - Use the appropriate folder to test different scenario. + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997435.474777][74695:74695] CHIP:EM: <<< [E:47404r S:56892 M:148152004 (Ack:209702583)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997435.474785][74695:74695] CHIP:IN: (S) Sending msg 148152004 on secure session with LSID: 56892 + [1693997435.474824][74695:74695] CHIP:DMG: Command handler moving to [CommandSen] + [1693997435.474828][74695:74695] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997435.474835][74695:74695] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997435.474838][74695:74695] CHIP:SVR: Failsafe timer expired + [1693997435.474842][74695:74695] CHIP:IN: SecureSession[0x55acdcc83540]: MarkForEviction Type:1 LSID:56892 + [1693997435.474846][74695:74695] CHIP:SC: SecureSession[0x55acdcc83540, LSID:56892]: State change 'kActive' --> 'kPendingEviction' + [1693997435.474861][74695:74695] CHIP:IN: SecureSession[0x55acdcc83540]: Released - Type:1 LSID:56892 + [1693997435.474869][74695:74695] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997435.474885][74695:74695] CHIP:IN: SecureSession[0x55acdcc83540]: Allocated Type:1 LSID:56894 + [1693997435.474890][74695:74695] CHIP:SC: Assigned local session key ID 56894 + [1693997435.474892][74695:74695] CHIP:SC: Waiting for PBKDF param request + disabled: true - The Vendor ID in the DAC does not match the vendor_id field in the Certification Declaration. - connectedhomeip/credentials/development/commissioner_dut/struct_cd_pid_array_count01_mismatch - & use the sample json test_case_vector.json + - label: + "Step 32: PAI Test Vector: Certificate Key Usage extension critical + field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset - Commission TH to DUT by using --dac_provider parameter + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider ~/connectedhomeip/credentials/development/commissioner_dut/struct_cd_pid_array_count10_mismatch/test_case_vector.json + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_critical_missing/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - If the DUT(chip-tool) has to provision to verify the logs:- verify the below mentioned same behaviour log on the DUT (chip-tool): - [1684496002.435208][176959:176961] CHIP:CTL: Performing next commissioning step 'AttestationVerification' - [1684496002.435210][176959:176961] CHIP:CTL: Verifying attestation - [1684496002.442231][176959:176961] CHIP:CTL: Failed in verifying 'Attestation Information' command received from the device: err 605. Look at AttestationVerificationResult enum to understand the errors - [1684496002.442244][176959:176961] CHIP:CTL: Error on commissioning step 'AttestationVerification': '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684496002.442248][176959:176961] CHIP:CTL: Failed to perform commissioning step 8 - [1684496002.442252][176959:176961] CHIP:CTL: Going from commissioning step 'AttestationVerification' with lastErr = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' -> 'Cleanup' - [1684496002.442259][176959:176961] CHIP:CTL: Performing next commissioning step 'Cleanup' with completion status = '../../third_party/connectedhomeip/src/controller/CHIPDeviceController.cpp:1075: CHIP Error 0x000000AC: Internal error' - [1684496002.442262][176959:176961] CHIP:CTL: Expiring failsafe on proxy 0x7f0354036bd0 - [1684496002.442275][176959:176961] CHIP:DMG: ICR moving to [AddingComm] - [1684496002.442279][176959:176961] CHIP:DMG: ICR moving to [AddedComma] - [1684496002.442334][176959:176961] CHIP:EM: <<< [E:26577i M:70580591] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest) - [1684496002.442340][176959:176961] CHIP:IN: (S) Sending msg 70580591 on secure session with LSID: 56268 - [1684496002.442397][176959:176961] CHIP:DMG: >> to UDP:[fe80::529f:9f59:cfec:7130%wlp0s20f3]:5540 | 70580591 | [Interaction Model (1) / InvokeCommandRequest (0x08) / Session = 4448 / Exchange = 26577] + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993961.436864][73215:73215] CHIP:EM: <<< [E:41036r S:15775 M:136220042 (Ack:221049132)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993961.436870][73215:73215] CHIP:IN: (S) Sending msg 136220042 on secure session with LSID: 15775 + [1693993961.436897][73215:73215] CHIP:DMG: Command handler moving to [CommandSen] + [1693993961.436901][73215:73215] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993961.436908][73215:73215] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993961.436912][73215:73215] CHIP:SVR: Failsafe timer expired + [1693993961.436915][73215:73215] CHIP:IN: SecureSession[0x55cace3a1a70]: MarkForEviction Type:1 LSID:15775 + [1693993961.436919][73215:73215] CHIP:SC: SecureSession[0x55cace3a1a70, LSID:15775]: State change 'kActive' --> 'kPendingEviction' + [1693993961.436936][73215:73215] CHIP:IN: SecureSession[0x55cace3a1a70]: Released - Type:1 LSID:15775 + [1693993961.436944][73215:73215] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993961.436983][73215:73215] CHIP:IN: SecureSession[0x55cace3a1a70]: Allocated Type:1 LSID:15777 + [1693993961.436990][73215:73215] CHIP:SC: Assigned local session key ID 15777 + [1693993961.436994][73215:73215] CHIP:SC: Waiting for PBKDF param request + [1693993961.437001][73215:73215] CHIP:DIS: Updating services using commissioning mode 1 + [1693993961.437268][73215:73215] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993961.437596][73215:73215] CHIP:DL: Using wifi MAC for hostname + [1693993961.437684][73215:73215] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 33: CD Test Vector: The product_id_array field has one PID value + that doesnt match the PID value in DAC." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count01_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994601.641020][73535:73535] CHIP:EM: <<< [E:59651r S:16286 M:42317111 (Ack:165156221)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994601.641028][73535:73535] CHIP:IN: (S) Sending msg 42317111 on secure session with LSID: 16286 + [1693994601.641053][73535:73535] CHIP:DMG: Command handler moving to [CommandSen] + [1693994601.641057][73535:73535] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994601.641064][73535:73535] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994601.641067][73535:73535] CHIP:SVR: Failsafe timer expired + [1693994601.641071][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: MarkForEviction Type:1 LSID:16286 + [1693994601.641075][73535:73535] CHIP:SC: SecureSession[0x558132a3cae0, LSID:16286]: State change 'kActive' --> 'kPendingEviction' + [1693994601.641091][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: Released - Type:1 LSID:16286 + [1693994601.641101][73535:73535] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994601.641116][73535:73535] CHIP:IN: SecureSession[0x558132a3cae0]: Allocated Type:1 LSID:16288 + [1693994601.641122][73535:73535] CHIP:SC: Assigned local session key ID 16288 + [1693994601.641126][73535:73535] CHIP:SC: Waiting for PBKDF param request + [1693994601.641134][73535:73535] CHIP:DIS: Updating services using commissioning mode 1 + [1693994601.641380][73535:73535] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994601.641631][73535:73535] CHIP:DL: Using wifi MAC for hostname + [1693994601.641667][73535:73535] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994601.641679][73535:73535] CHIP:DIS: Responding with _matterc._udp.local + disabled: true + + - label: + "Step 34: DAC Test Vector: Certificate Basic Constraint extension + critical field is set as 'non-critical'" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_critical_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994309.863989][73393:73393] CHIP:EM: <<< [E:13816r S:50685 M:35649942 (Ack:85667731)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994309.863996][73393:73393] CHIP:IN: (S) Sending msg 35649942 on secure session with LSID: 50685 + [1693994309.864019][73393:73393] CHIP:DMG: Command handler moving to [CommandSen] + [1693994309.864022][73393:73393] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994309.864028][73393:73393] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994309.864031][73393:73393] CHIP:SVR: Failsafe timer expired + [1693994309.864034][73393:73393] CHIP:IN: SecureSession[0x560989b2fa30]: MarkForEviction Type:1 LSID:50685 + [1693994309.864038][73393:73393] CHIP:SC: SecureSession[0x560989b2fa30, LSID:50685]: State change 'kActive' --> 'kPendingEviction' + [1693994309.864053][73393:73393] CHIP:IN: SecureSession[0x560989b2fa30]: Released - Type:1 LSID:50685 + [1693994309.864060][73393:73393] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994309.864075][73393:73393] CHIP:IN: SecureSession[0x560989b2fa30]: Allocated Type:1 LSID:50687 + [1693994309.864081][73393:73393] CHIP:SC: Assigned local session key ID 50687 + [1693994309.864084][73393:73393] CHIP:SC: Waiting for PBKDF param request + [1693994309.864091][73393:73393] CHIP:DIS: Updating services using commissioning mode 1 + [1693994309.864315][73393:73393] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994309.864596][73393:73393] CHIP:DL: Using wifi MAC for hostname + [1693994309.864631][73393:73393] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994309.864643][73393:73393] CHIP:DIS: Responding with _matterc._udp.local + [1693994309.864648][73393:73393] CHIP:DIS: Responding with 6D23ADC224752D59._matterc._udp.local + [1693994309.864652][73393:73393] CHIP:DIS: Responding with 8C1D96786A130000.local + disabled: true + + - label: + "Step 35: DAC Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mvid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_06/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995171.970121][73778:73778] CHIP:EM: <<< [E:44422r S:47062 M:155461515 (Ack:70593203)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995171.970128][73778:73778] CHIP:IN: (S) Sending msg 155461515 on secure session with LSID: 47062 + [1693995171.970162][73778:73778] CHIP:DMG: Command handler moving to [CommandSen] + [1693995171.970165][73778:73778] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995171.970170][73778:73778] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995171.970173][73778:73778] CHIP:SVR: Failsafe timer expired + [1693995171.970176][73778:73778] CHIP:IN: SecureSession[0x55ef8a8d4550]: MarkForEviction Type:1 LSID:47062 + [1693995171.970179][73778:73778] CHIP:SC: SecureSession[0x55ef8a8d4550, LSID:47062]: State change 'kActive' --> 'kPendingEviction' + [1693995171.970191][73778:73778] CHIP:IN: SecureSession[0x55ef8a8d4550]: Released - Type:1 LSID:47062 + [1693995171.970198][73778:73778] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995171.970211][73778:73778] CHIP:IN: SecureSession[0x55ef8a8d4550]: Allocated Type:1 LSID:47064 + [1693995171.970216][73778:73778] CHIP:SC: Assigned local session key ID 47064 + [1693995171.970218][73778:73778] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 36: DAC Test Vector: Certificate Basic Constraint extension + critical field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. please use the equivalent command on your respective platform to perform a factory reset Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_critical_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997539.063813][74749:74749] CHIP:DMG: + [1693997539.063820][74749:74749] CHIP:EM: <<< [E:17379r S:53226 M:29102807 (Ack:182470622)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997539.063826][74749:74749] CHIP:IN: (S) Sending msg 29102807 on secure session with LSID: 53226 + [1693997539.063845][74749:74749] CHIP:DMG: Command handler moving to [CommandSen] + [1693997539.063848][74749:74749] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997539.063852][74749:74749] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997539.063854][74749:74749] CHIP:SVR: Failsafe timer expired + [1693997539.063857][74749:74749] CHIP:IN: SecureSession[0x55bfe0573aa0]: MarkForEviction Type:1 LSID:53226 + [1693997539.063859][74749:74749] CHIP:SC: SecureSession[0x55bfe0573aa0, LSID:53226]: State change 'kActive' --> 'kPendingEviction' + [1693997539.063872][74749:74749] CHIP:IN: SecureSession[0x55bfe0573aa0]: Released - Type:1 LSID:53226 + [1693997539.063879][74749:74749] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997539.063893][74749:74749] CHIP:IN: SecureSession[0x55bfe0573aa0]: Allocated Type:1 LSID:53228 + [1693997539.063897][74749:74749] CHIP:SC: Assigned local session key ID 53228 + [1693997539.063900][74749:74749] CHIP:SC: Waiting for PBKDF param request + [1693997539.063905][74749:74749] CHIP:DIS: Updating services using commissioning mode 1 + [1693997539.064082][74749:74749] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693997539.064286][74749:74749] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 37: PAI Test Vector: Certificate Key Usage extension critical + field is set as 'non-critical'" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_critical_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995025.206031][73723:73723] CHIP:EM: <<< [E:52837r S:34496 M:253072011 (Ack:204014627)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995025.206038][73723:73723] CHIP:IN: (S) Sending msg 253072011 on secure session with LSID: 34496 + [1693995025.206074][73723:73723] CHIP:DMG: Command handler moving to [CommandSen] + [1693995025.206077][73723:73723] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995025.206084][73723:73723] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995025.206088][73723:73723] CHIP:SVR: Failsafe timer expired + [1693995025.206091][73723:73723] CHIP:IN: SecureSession[0x563c42ebaa40]: MarkForEviction Type:1 LSID:34496 + [1693995025.206094][73723:73723] CHIP:SC: SecureSession[0x563c42ebaa40, LSID:34496]: State change 'kActive' --> 'kPendingEviction' + [1693995025.206106][73723:73723] CHIP:IN: SecureSession[0x563c42ebaa40]: Released - Type:1 LSID:34496 + [1693995025.206114][73723:73723] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995025.206129][73723:73723] CHIP:IN: SecureSession[0x563c42ebaa40]: Allocated Type:1 LSID:34498 + [1693995025.206134][73723:73723] CHIP:SC: Assigned local session key ID 34498 + [1693995025.206137][73723:73723] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 38: PAI Test Vector: Fallback VID and PID encoding example: + invalid PID and VID prefixes" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_14/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996721.242096][74349:74349] CHIP:EM: <<< [E:47891r S:48954 M:258386198 (Ack:60536202)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996721.242101][74349:74349] CHIP:IN: (S) Sending msg 258386198 on secure session with LSID: 48954 + [1693996721.242123][74349:74349] CHIP:DMG: Command handler moving to [CommandSen] + [1693996721.242126][74349:74349] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996721.242132][74349:74349] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996721.242135][74349:74349] CHIP:SVR: Failsafe timer expired + [1693996721.242138][74349:74349] CHIP:IN: SecureSession[0x55d6b6c90c30]: MarkForEviction Type:1 LSID:48954 + [1693996721.242141][74349:74349] CHIP:SC: SecureSession[0x55d6b6c90c30, LSID:48954]: State change 'kActive' --> 'kPendingEviction' + [1693996721.242152][74349:74349] CHIP:IN: SecureSession[0x55d6b6c90c30]: Released - Type:1 LSID:48954 + [1693996721.242160][74349:74349] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996721.242174][74349:74349] CHIP:IN: SecureSession[0x55d6b6c90c30]: Allocated Type:1 LSID:48956 + [1693996721.242179][74349:74349] CHIP:SC: Assigned local session key ID 48956 + [1693996721.242181][74349:74349] CHIP:SC: Waiting for PBKDF param request + [1693996721.242186][74349:74349] CHIP:DIS: Updating services using commissioning mode 1 + [1693996721.242372][74349:74349] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693996721.242610][74349:74349] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 39: CD Test Vector: Invalid CMS signature algorithm + ECDSA_WITH_SHA1." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_sig_algo_ecdsa_with_sha1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995350.564731][73881:73881] CHIP:EM: <<< [E:31060r S:37954 M:110559466 (Ack:22034170)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995350.564739][73881:73881] CHIP:IN: (S) Sending msg 110559466 on secure session with LSID: 37954 + [1693995350.564804][73881:73881] CHIP:DMG: Command handler moving to [CommandSen] + [1693995350.564809][73881:73881] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995350.564815][73881:73881] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995350.564821][73881:73881] CHIP:SVR: Failsafe timer expired + [1693995350.564824][73881:73881] CHIP:IN: SecureSession[0x555ee4e66ad0]: MarkForEviction Type:1 LSID:37954 + [1693995350.564828][73881:73881] CHIP:SC: SecureSession[0x555ee4e66ad0, LSID:37954]: State change 'kActive' --> 'kPendingEviction' + [1693995350.564846][73881:73881] CHIP:IN: SecureSession[0x555ee4e66ad0]: Released - Type:1 LSID:37954 + [1693995350.564855][73881:73881] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995350.564874][73881:73881] CHIP:IN: SecureSession[0x555ee4e66ad0]: Allocated Type:1 LSID:37956 + [1693995350.564880][73881:73881] CHIP:SC: Assigned local session key ID 37956 + [1693995350.564884][73881:73881] CHIP:SC: Waiting for PBKDF param request + [1693995350.564891][73881:73881] CHIP:DIS: Updating services using commissioning mode 1 + [1693995350.565399][73881:73881] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995350.565716][73881:73881] CHIP:DL: Using wifi MAC for hostname + [1693995350.565759][73881:73881] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 40: PAI Test Vector: Mix of Fallback and Matter OID encoding for + VID and PID: invalid, PID is using Matter OID then VID must also use + Matter OID" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_17/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996944.027234][74452:74452] CHIP:EM: <<< [E:15428r S:21228 M:66013482 (Ack:15185004)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996944.027239][74452:74452] CHIP:IN: (S) Sending msg 66013482 on secure session with LSID: 21228 + [1693996944.027258][74452:74452] CHIP:DMG: Command handler moving to [CommandSen] + [1693996944.027261][74452:74452] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996944.027265][74452:74452] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996944.027267][74452:74452] CHIP:SVR: Failsafe timer expired + [1693996944.027270][74452:74452] CHIP:IN: SecureSession[0x55f1c2dc3ad0]: MarkForEviction Type:1 LSID:21228 + [1693996944.027273][74452:74452] CHIP:SC: SecureSession[0x55f1c2dc3ad0, LSID:21228]: State change 'kActive' --> 'kPendingEviction' + disabled: true + + - label: + "Step 41: CD Test Vector: The authorized_paa_list contains three PAAs + none of which is a valid PAA authorized to sign the PAI." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count3_invalid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994994.295582][73706:73706] CHIP:EM: <<< [E:29330r S:9576 M:87938545 (Ack:262262590)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994994.295590][73706:73706] CHIP:IN: (S) Sending msg 87938545 on secure session with LSID: 9576 + [1693994994.295630][73706:73706] CHIP:DMG: Command handler moving to [CommandSen] + [1693994994.295633][73706:73706] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994994.295640][73706:73706] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994994.295643][73706:73706] CHIP:SVR: Failsafe timer expired + [1693994994.295647][73706:73706] CHIP:IN: SecureSession[0x55ea1bc20f20]: MarkForEviction Type:1 LSID:9576 + [1693994994.295650][73706:73706] CHIP:SC: SecureSession[0x55ea1bc20f20, LSID:9576]: State change 'kActive' --> 'kPendingEviction' + [1693994994.295666][73706:73706] CHIP:IN: SecureSession[0x55ea1bc20f20]: Released - Type:1 LSID:9576 + [1693994994.295674][73706:73706] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994994.295692][73706:73706] CHIP:IN: SecureSession[0x55ea1bc20f20]: Allocated Type:1 LSID:9578 + [1693994994.295697][73706:73706] CHIP:SC: Assigned local session key ID 9578 + [1693994994.295701][73706:73706] CHIP:SC: Waiting for PBKDF param request + [1693994994.295708][73706:73706] CHIP:DIS: Updating services using commissioning mode 1 + [1693994994.295955][73706:73706] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994994.296232][73706:73706] CHIP:DL: Using wifi MAC for hostname + [1693994994.296270][73706:73706] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 42: DAC Test Vector: Certificate Key Usage extension keyCertSign + field is wrong (present for DAC and not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_key_usage_key_cert_sign_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997493.187931][74723:74723] CHIP:IN: (S) Sending msg 140235257 on secure session with LSID: 31830 + [1693997493.187962][74723:74723] CHIP:DMG: Command handler moving to [CommandSen] + [1693997493.187965][74723:74723] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997493.187970][74723:74723] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997493.187974][74723:74723] CHIP:SVR: Failsafe timer expired + [1693997493.187977][74723:74723] CHIP:IN: SecureSession[0x55ceb536ba00]: MarkForEviction Type:1 LSID:31830 + [1693997493.187981][74723:74723] CHIP:SC: SecureSession[0x55ceb536ba00, LSID:31830]: State change 'kActive' --> 'kPendingEviction' + [1693997493.187997][74723:74723] CHIP:IN: SecureSession[0x55ceb536ba00]: Released - Type:1 LSID:31830 + [1693997493.188008][74723:74723] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997493.188029][74723:74723] CHIP:IN: SecureSession[0x55ceb536ba00]: Allocated Type:1 LSID:31832 + [1693997493.188036][74723:74723] CHIP:SC: Assigned local session key ID 31832 + [1693997493.188040][74723:74723] CHIP:SC: Waiting for PBKDF param request + [1693997493.188048][74723:74723] CHIP:DIS: Updating services using commissioning mode 1 + [1693997493.188313][74723:74723] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 43: PAI Test Vector: Certificate validity period starts in the + future" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_valid_in_future/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + 1693994070.857421][73264:73264] CHIP:DMG: peer_address = UDP:[fe80::a70c:61dc:df51:6945%enxd03745ce8f62]:59736 + [1693994070.857423][73264:73264] CHIP:DMG: } + [1693994070.857425][73264:73264] CHIP:DMG: + [1693994070.857437][73264:73264] CHIP:EM: <<< [E:18036r S:31986 M:116453148 (Ack:226659157)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994070.857443][73264:73264] CHIP:IN: (S) Sending msg 116453148 on secure session with LSID: 31986 + [1693994070.857472][73264:73264] CHIP:DMG: Command handler moving to [CommandSen] + [1693994070.857474][73264:73264] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994070.857479][73264:73264] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994070.857482][73264:73264] CHIP:SVR: Failsafe timer expired + [1693994070.857485][73264:73264] CHIP:IN: SecureSession[0x560a76fb7890]: MarkForEviction Type:1 LSID:31986 + [1693994070.857488][73264:73264] CHIP:SC: SecureSession[0x560a76fb7890, LSID:31986]: State change 'kActive' --> 'kPendingEviction' + [1693994070.857500][73264:73264] CHIP:IN: SecureSession[0x560a76fb7890]: Released - Type:1 LSID:31986 + [1693994070.857506][73264:73264] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994070.857521][73264:73264] CHIP:IN: SecureSession[0x560a76fb7890]: Allocated Type:1 LSID:31988 + [1693994070.857525][73264:73264] CHIP:SC: Assigned local session key ID 31988 + [1693994070.857528][73264:73264] CHIP:SC: Waiting for PBKDF param request + [1693994070.857534][73264:73264] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 44: PAI Test Vector: Invalid certificate public key curve + secp256k1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_sig_curve_secp256k1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994937.114088][73683:73683] CHIP:EM: <<< [E:49715r S:13754 M:244879345 (Ack:52354936)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994937.114096][73683:73683] CHIP:IN: (S) Sending msg 244879345 on secure session with LSID: 13754 + [1693994937.114120][73683:73683] CHIP:DMG: Command handler moving to [CommandSen] + [1693994937.114123][73683:73683] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994937.114130][73683:73683] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994937.114133][73683:73683] CHIP:SVR: Failsafe timer expired + [1693994937.114137][73683:73683] CHIP:IN: SecureSession[0x56311376d960]: MarkForEviction Type:1 LSID:13754 + [1693994937.114141][73683:73683] CHIP:SC: SecureSession[0x56311376d960, LSID:13754]: State change 'kActive' --> 'kPendingEviction' + [1693994937.114157][73683:73683] CHIP:IN: SecureSession[0x56311376d960]: Released - Type:1 LSID:13754 + [1693994937.114165][73683:73683] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994937.114183][73683:73683] CHIP:IN: SecureSession[0x56311376d960]: Allocated Type:1 LSID:13756 + [1693994937.114188][73683:73683] CHIP:SC: Assigned local session key ID 13756 + [1693994937.114191][73683:73683] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 45: PAI Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mvid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_07/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995853.450434][74013:74013] CHIP:EM: <<< [E:22061r S:8988 M:191746032 (Ack:245185446)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995853.450441][74013:74013] CHIP:IN: (S) Sending msg 191746032 on secure session with LSID: 8988 + [1693995853.450472][74013:74013] CHIP:DMG: Command handler moving to [CommandSen] + [1693995853.450476][74013:74013] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995853.450484][74013:74013] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995853.450488][74013:74013] CHIP:SVR: Failsafe timer expired + [1693995853.450491][74013:74013] CHIP:IN: SecureSession[0x5607aeef1750]: MarkForEviction Type:1 LSID:8988 + [1693995853.450496][74013:74013] CHIP:SC: SecureSession[0x5607aeef1750, LSID:8988]: State change 'kActive' --> 'kPendingEviction' + [1693995853.450512][74013:74013] CHIP:IN: SecureSession[0x5607aeef1750]: Released - Type:1 LSID:8988 + [1693995853.450521][74013:74013] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995853.450539][74013:74013] CHIP:IN: SecureSession[0x5607aeef1750]: Allocated Type:1 LSID:8990 + [1693995853.450545][74013:74013] CHIP:SC: Assigned local session key ID 8990 + [1693995853.450549][74013:74013] CHIP:SC: Waiting for PBKDF param request + [1693995853.450556][74013:74013] CHIP:DIS: Updating services using commissioning mode 1 + [1693995853.450823][74013:74013] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995853.451182][74013:74013] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: "Step 46: CD Test Vector: The certificate_id field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cert_id_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996750.060075][74364:74364] CHIP:DMG: } + [1693996750.060078][74364:74364] CHIP:DMG: + [1693996750.060094][74364:74364] CHIP:EM: <<< [E:50586r S:36416 M:141787643 (Ack:100004491)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996750.060102][74364:74364] CHIP:IN: (S) Sending msg 141787643 on secure session with LSID: 36416 + [1693996750.060145][74364:74364] CHIP:DMG: Command handler moving to [CommandSen] + [1693996750.060149][74364:74364] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996750.060156][74364:74364] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996750.060161][74364:74364] CHIP:SVR: Failsafe timer expired + [1693996750.060165][74364:74364] CHIP:IN: SecureSession[0x560b65cef920]: MarkForEviction Type:1 LSID:36416 + [1693996750.060169][74364:74364] CHIP:SC: SecureSession[0x560b65cef920, LSID:36416]: State change 'kActive' --> 'kPendingEviction' + [1693996750.060185][74364:74364] CHIP:IN: SecureSession[0x560b65cef920]: Released - Type:1 LSID:36416 + [1693996750.060196][74364:74364] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996750.060212][74364:74364] CHIP:IN: SecureSession[0x560b65cef920]: Allocated Type:1 LSID:36418 + [1693996750.060218][74364:74364] CHIP:SC: Assigned local session key ID 36418 + disabled: true + + - label: + "Step 47: PAI Test Vector: Certificate Basic Constraint extension + PathLen field set to 2" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_pathlen2/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993901.970537][73174:73174] CHIP:EM: <<< [E:59335r S:48771 M:10059134 (Ack:95539287)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993901.970544][73174:73174] CHIP:IN: (S) Sending msg 10059134 on secure session with LSID: 48771 + [1693993901.970584][73174:73174] CHIP:DMG: Command handler moving to [CommandSen] + [1693993901.970587][73174:73174] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993901.970593][73174:73174] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993901.970597][73174:73174] CHIP:SVR: Failsafe timer expired + [1693993901.970599][73174:73174] CHIP:IN: SecureSession[0x55f05c3b8a90]: MarkForEviction Type:1 LSID:48771 + [1693993901.970611][73174:73174] CHIP:SC: SecureSession[0x55f05c3b8a90, LSID:48771]: State change 'kActive' --> 'kPendingEviction' + [1693993901.970623][73174:73174] CHIP:IN: SecureSession[0x55f05c3b8a90]: Released - Type:1 LSID:48771 + [1693993901.970631][73174:73174] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993901.970646][73174:73174] CHIP:IN: SecureSession[0x55f05c3b8a90]: Allocated Type:1 LSID:48773 + [1693993901.970651][73174:73174] CHIP:SC: Assigned local session key ID 48773 + [1693993901.970654][73174:73174] CHIP:SC: Waiting for PBKDF param request + [1693993901.970660][73174:73174] CHIP:DIS: Updating services using commissioning mode 1 + [1693993901.970850][73174:73174] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993901.971123][73174:73174] CHIP:DL: Using wifi MAC for hostname + [1693993901.971159][73174:73174] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 48: DAC Test Vector: Fallback VID and PID encoding example: + invalid PID and VID prefixes" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_14/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995817.508655][74000:74000] CHIP:EM: <<< [E:7012r S:58652 M:202734303 (Ack:196860855)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995817.508663][74000:74000] CHIP:IN: (S) Sending msg 202734303 on secure session with LSID: 58652 + [1693995817.508694][74000:74000] CHIP:DMG: Command handler moving to [CommandSen] + [1693995817.508698][74000:74000] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995817.508706][74000:74000] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995817.508710][74000:74000] CHIP:SVR: Failsafe timer expired + [1693995817.508714][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: MarkForEviction Type:1 LSID:58652 + [1693995817.508718][74000:74000] CHIP:SC: SecureSession[0x55963a9cecb0, LSID:58652]: State change 'kActive' --> 'kPendingEviction' + [1693995817.508735][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: Released - Type:1 LSID:58652 + [1693995817.508745][74000:74000] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995817.508764][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: Allocated Type:1 LSID:58654 + [1693995817.508771][74000:74000] CHIP:SC: Assigned local session key ID 58654 + [1693995817.508775][74000:74000] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 49: PAI Test Vector: Mix of Fallback and Matter OID encoding for + VID and PID: wrong, Correct values encoded in the common-name are + ignored" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_16/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994734.416781][73585:73585] CHIP:EM: <<< [E:35581r S:34867 M:147536613 (Ack:100758548)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994734.416786][73585:73585] CHIP:IN: (S) Sending msg 147536613 on secure session with LSID: 34867 + [1693994734.416806][73585:73585] CHIP:DMG: Command handler moving to [CommandSen] + [1693994734.416809][73585:73585] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994734.416813][73585:73585] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994734.416816][73585:73585] CHIP:SVR: Failsafe timer expired + [1693994734.416818][73585:73585] CHIP:IN: SecureSession[0x56009a87aac0]: MarkForEviction Type:1 LSID:34867 + [1693994734.416821][73585:73585] CHIP:SC: SecureSession[0x56009a87aac0, LSID:34867]: State change 'kActive' --> 'kPendingEviction' + [1693994734.416832][73585:73585] CHIP:IN: SecureSession[0x56009a87aac0]: Released - Type:1 LSID:34867 + [1693994734.416839][73585:73585] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994734.416853][73585:73585] CHIP:IN: SecureSession[0x56009a87aac0]: Allocated Type:1 LSID:34869 + [1693994734.416858][73585:73585] CHIP:SC: Assigned local session key ID 34869 + [1693994734.416860][73585:73585] CHIP:SC: Waiting for PBKDF param request + [1693994734.416866][73585:73585] CHIP:DIS: Updating services using commissioning mode 1 + [1693994734.417065][73585:73585] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994734.417279][73585:73585] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 50: PAI Test Vector: Invalid certificate version field set to + v2(1)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_cert_version_v2/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996775.308293][74381:74381] CHIP:EM: <<< [E:59252r S:59214 M:230492921 (Ack:3210801)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996775.308305][74381:74381] CHIP:IN: (S) Sending msg 230492921 on secure session with LSID: 59214 + [1693996775.308363][74381:74381] CHIP:DMG: Command handler moving to [CommandSen] + [1693996775.308369][74381:74381] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996775.308378][74381:74381] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996775.308386][74381:74381] CHIP:SVR: Failsafe timer expired + [1693996775.308389][74381:74381] CHIP:IN: SecureSession[0x556753b05890]: MarkForEviction Type:1 LSID:59214 + [1693996775.308393][74381:74381] CHIP:SC: SecureSession[0x556753b05890, LSID:59214]: State change 'kActive' --> 'kPendingEviction' + [1693996775.308406][74381:74381] CHIP:IN: SecureSession[0x556753b05890]: Released - Type:1 LSID:59214 + [1693996775.308414][74381:74381] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996775.308430][74381:74381] CHIP:IN: SecureSession[0x556753b05890]: Allocated Type:1 LSID:59216 + [1693996775.308435][74381:74381] CHIP:SC: Assigned local session key ID 59216 + [1693996775.308438][74381:74381] CHIP:SC: Waiting for PBKDF param request + [1693996775.308444][74381:74381] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 51: PAI Test Vector: Certificate doesnt include Key Usage + extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996976.416497][74466:74466] CHIP:EM: <<< [E:48220r S:55511 M:104568595 (Ack:25835293)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996976.416502][74466:74466] CHIP:IN: (S) Sending msg 104568595 on secure session with LSID: 55511 + [1693996976.416520][74466:74466] CHIP:DMG: Command handler moving to [CommandSen] + [1693996976.416522][74466:74466] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996976.416526][74466:74466] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996976.416529][74466:74466] CHIP:SVR: Failsafe timer expired + [1693996976.416531][74466:74466] CHIP:IN: SecureSession[0x55dadcc3e990]: MarkForEviction Type:1 LSID:55511 + [1693996976.416534][74466:74466] CHIP:SC: SecureSession[0x55dadcc3e990, LSID:55511]: State change 'kActive' --> 'kPendingEviction' + [1693996976.416545][74466:74466] CHIP:IN: SecureSession[0x55dadcc3e990]: Released - Type:1 LSID:55511 + [1693996976.416552][74466:74466] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996976.416565][74466:74466] CHIP:IN: SecureSession[0x55dadcc3e990]: Allocated Type:1 LSID:55513 + [1693996976.416569][74466:74466] CHIP:SC: Assigned local session key ID 55513 + disabled: true + + - label: + "Step 52: DAC Test Vector: Certificate Basic Constraint extension + PathLen field set to 0" + verification: | + Factory reset the TH(all-clusters-app) - Below mentioned command is for RPI, PIs use equivalent command on their respective platform) + command when using chip-all-clusters-app: sudo rm -rf /tmp/chip_* + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_pathlen0/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993355.537189][72739:72739] CHIP:EM: <<< [E:46949r S:42353 M:75820384 (Ack:69095779)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993355.537196][72739:72739] CHIP:IN: (S) Sending msg 75820384 on secure session with LSID: 42353 + [1693993355.537235][72739:72739] CHIP:DMG: Command handler moving to [CommandSen] + [1693993355.537239][72739:72739] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993355.537245][72739:72739] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993355.537249][72739:72739] CHIP:SVR: Failsafe timer expired + [1693993355.537252][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: MarkForEviction Type:1 LSID:42353 + [1693993355.537256][72739:72739] CHIP:SC: SecureSession[0x561e088c6c60, LSID:42353]: State change 'kActive' --> 'kPendingEviction' + [1693993355.537273][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: Released - Type:1 LSID:42353 + [1693993355.537284][72739:72739] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993355.537303][72739:72739] CHIP:IN: SecureSession[0x561e088c6c60]: Allocated Type:1 LSID:42355 + [1693993355.537308][72739:72739] CHIP:SC: Assigned local session key ID 42355 + [1693993355.537311][72739:72739] CHIP:SC: Waiting for PBKDF param request + [1693993355.537318][72739:72739] CHIP:DIS: Updating services using commissioning mode 1 + [1693993355.537588][72739:72739] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993355.537857][72739:72739] CHIP:DL: Using wifi MAC for hostname + [1693993355.537907][72739:72739] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693993355.537920][72739:72739] CHIP:DIS: Responding with _matterc._udp.local + [1693993355.537923][72739:72739] CHIP:DIS: Responding with 341D2ED7D15535D3._matterc._udp.local + [1693993355.537926][72739:72739] CHIP:DIS: Responding with 8C1D96786A130000.local + [1693993355.537929][72739:72739] CHIP:DIS: Responding with 8C1D96786A130000.local + disabled: true + + - label: "Step 53: CD Test Vector: The vendor_id field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_vid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + o 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997124.337991][74541:74541] CHIP:IN: (S) Sending msg 235587990 on secure session with LSID: 11133 + [1693997124.338037][74541:74541] CHIP:DMG: Command handler moving to [CommandSen] + [1693997124.338040][74541:74541] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997124.338049][74541:74541] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997124.338053][74541:74541] CHIP:SVR: Failsafe timer expired + [1693997124.338057][74541:74541] CHIP:IN: SecureSession[0x558830cce0e0]: MarkForEviction Type:1 LSID:11133 + [1693997124.338062][74541:74541] CHIP:SC: SecureSession[0x558830cce0e0, LSID:11133]: State change 'kActive' --> 'kPendingEviction' + [1693997124.338084][74541:74541] CHIP:IN: SecureSession[0x558830cce0e0]: Released - Type:1 LSID:11133 + [1693997124.338092][74541:74541] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997124.338111][74541:74541] CHIP:IN: SecureSession[0x558830cce0e0]: Allocated Type:1 LSID:11135 + [1693997124.338116][74541:74541] CHIP:SC: Assigned local session key ID 11135 + [1693997124.338119][74541:74541] CHIP:SC: Waiting for PBKDF param request + [1693997124.338126][74541:74541] CHIP:DIS: Updating services using commissioning mode 1 + [1693997124.338452][74541:74541] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: "Step 54: CD Test Vector: The version_number field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_version_number_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994668.691517][73554:73554] CHIP:EM: <<< [E:27863r S:51711 M:249269395 (Ack:246852262)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994668.691525][73554:73554] CHIP:IN: (S) Sending msg 249269395 on secure session with LSID: 51711 + [1693994668.691552][73554:73554] CHIP:DMG: Command handler moving to [CommandSen] + [1693994668.691556][73554:73554] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994668.691563][73554:73554] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994668.691567][73554:73554] CHIP:SVR: Failsafe timer expired + [1693994668.691570][73554:73554] CHIP:IN: SecureSession[0x55646b0adce0]: MarkForEviction Type:1 LSID:51711 + [1693994668.691574][73554:73554] CHIP:SC: SecureSession[0x55646b0adce0, LSID:51711]: State change 'kActive' --> 'kPendingEviction' + [1693994668.691590][73554:73554] CHIP:IN: SecureSession[0x55646b0adce0]: Released - Type:1 LSID:51711 + [1693994668.691600][73554:73554] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994668.691618][73554:73554] CHIP:IN: SecureSession[0x55646b0adce0]: Allocated Type:1 LSID:51713 + [1693994668.691624][73554:73554] CHIP:SC: Assigned local session key ID 51713 + [1693994668.691628][73554:73554] CHIP:SC: Waiting for PBKDF param request + [1693994668.691635][73554:73554] CHIP:DIS: Updating services using commissioning mode 1 + [1693994668.691882][73554:73554] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994668.692178][73554:73554] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 55: DAC Test Vector: Certificate validity period starts in the + past" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_valid_in_past/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997610.132909][74792:74792] CHIP:EM: <<< [E:21455r S:37082 M:136294811 (Ack:124710680)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997610.132915][74792:74792] CHIP:IN: (S) Sending msg 136294811 on secure session with LSID: 37082 + [1693997610.132934][74792:74792] CHIP:DMG: Command handler moving to [CommandSen] + [1693997610.132936][74792:74792] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997610.132941][74792:74792] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997610.132943][74792:74792] CHIP:SVR: Failsafe timer expired + [1693997610.132945][74792:74792] CHIP:IN: SecureSession[0x55efecb47930]: MarkForEviction Type:1 LSID:37082 + [1693997610.132977][74792:74792] CHIP:SC: SecureSession[0x55efecb47930, LSID:37082]: State change 'kActive' --> 'kPendingEviction' + [1693997610.132996][74792:74792] CHIP:IN: SecureSession[0x55efecb47930]: Released - Type:1 LSID:37082 + [1693997610.133003][74792:74792] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997610.133019][74792:74792] CHIP:IN: SecureSession[0x55efecb47930]: Allocated Type:1 LSID:37084 + [1693997610.133023][74792:74792] CHIP:SC: Assigned local session key ID 37084 + [1693997610.133026][74792:74792] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 56: PAI Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mvid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_06/test_case_vector.json --product-id 177 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997369.939646][74668:74668] CHIP:EM: <<< [E:49580r S:11334 M:240277268 (Ack:200111746)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997369.939653][74668:74668] CHIP:IN: (S) Sending msg 240277268 on secure session with LSID: 11334 + [1693997369.939701][74668:74668] CHIP:DMG: Command handler moving to [CommandSen] + [1693997369.939705][74668:74668] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997369.939712][74668:74668] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997369.939715][74668:74668] CHIP:SVR: Failsafe timer expired + [1693997369.939718][74668:74668] CHIP:IN: SecureSession[0x55aa26bb87e0]: MarkForEviction Type:1 LSID:11334 + [1693997369.939720][74668:74668] CHIP:SC: SecureSession[0x55aa26bb87e0, LSID:11334]: State change 'kActive' --> 'kPendingEviction' + [1693997369.939733][74668:74668] CHIP:IN: SecureSession[0x55aa26bb87e0]: Released - Type:1 LSID:11334 + [1693997369.939743][74668:74668] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997369.939771][74668:74668] CHIP:IN: SecureSession[0x55aa26bb87e0]: Allocated Type:1 LSID:11336 + [1693997369.939778][74668:74668] CHIP:SC: Assigned local session key ID 11336 + [1693997369.939781][74668:74668] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 57: CD Test Vector: The certification_type field is set to + invalid value." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cert_type_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997345.986044][74654:74654] CHIP:IN: (S) Sending msg 9093635 on secure session with LSID: 5249 + [1693997345.986063][74654:74654] CHIP:DMG: Command handler moving to [CommandSen] + [1693997345.986066][74654:74654] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997345.986071][74654:74654] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997345.986073][74654:74654] CHIP:SVR: Failsafe timer expired + [1693997345.986076][74654:74654] CHIP:IN: SecureSession[0x55e15dc92d30]: MarkForEviction Type:1 LSID:5249 + [1693997345.986079][74654:74654] CHIP:SC: SecureSession[0x55e15dc92d30, LSID:5249]: State change 'kActive' --> 'kPendingEviction' + [1693997345.986090][74654:74654] CHIP:IN: SecureSession[0x55e15dc92d30]: Released - Type:1 LSID:5249 + [1693997345.986097][74654:74654] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997345.986110][74654:74654] CHIP:IN: SecureSession[0x55e15dc92d30]: Allocated Type:1 LSID:5251 + [1693997345.986114][74654:74654] CHIP:SC: Assigned local session key ID 5251 + [1693997345.986117][74654:74654] CHIP:SC: Waiting for PBKDF param request + [1693997345.986122][74654:74654] CHIP:DIS: Updating services using commissioning mode 1 + [1693997345.986297][74654:74654] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693997345.986518][74654:74654] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 58: PAI Test Vector: Certificate Basic Constraint extension + critical field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_critical_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995141.040391][73748:73748] CHIP:IN: (S) Sending msg 13082630 on secure session with LSID: 25697 + [1693995141.040415][73748:73748] CHIP:DMG: Command handler moving to [CommandSen] + [1693995141.040418][73748:73748] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995141.040422][73748:73748] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995141.040425][73748:73748] CHIP:SVR: Failsafe timer expired + [1693995141.040427][73748:73748] CHIP:IN: SecureSession[0x5595f22b8a70]: MarkForEviction Type:1 LSID:25697 + [1693995141.040431][73748:73748] CHIP:SC: SecureSession[0x5595f22b8a70, LSID:25697]: State change 'kActive' --> 'kPendingEviction' + [1693995141.040444][73748:73748] CHIP:IN: SecureSession[0x5595f22b8a70]: Released - Type:1 LSID:25697 + [1693995141.040453][73748:73748] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995141.040469][73748:73748] CHIP:IN: SecureSession[0x5595f22b8a70]: Allocated Type:1 LSID:25699 + [1693995141.040474][73748:73748] CHIP:SC: Assigned local session key ID 25699 + [1693995141.040477][73748:73748] CHIP:SC: Waiting for PBKDF param request + [1693995141.040483][73748:73748] CHIP:DIS: Updating services using commissioning mode 1 + [1693995141.040688][73748:73748] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995141.040929][73748:73748] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 59: DAC Test Vector: Mix of Fallback and Matter OID encoding for + VID and PID: wrong, Correct values encoded in the common-name are + ignored" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_10/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994569.856552][73521:73521] CHIP:IN: (S) Sending msg 148377031 on secure session with LSID: 36938 + [1693994569.856571][73521:73521] CHIP:DMG: Command handler moving to [CommandSen] + [1693994569.856573][73521:73521] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994569.856577][73521:73521] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994569.856580][73521:73521] CHIP:SVR: Failsafe timer expired + [1693994569.856582][73521:73521] CHIP:IN: SecureSession[0x559724af7a80]: MarkForEviction Type:1 LSID:36938 + [1693994569.856585][73521:73521] CHIP:SC: SecureSession[0x559724af7a80, LSID:36938]: State change 'kActive' --> 'kPendingEviction' + [1693994569.856595][73521:73521] CHIP:IN: SecureSession[0x559724af7a80]: Released - Type:1 LSID:36938 + [1693994569.856602][73521:73521] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994569.856615][73521:73521] CHIP:IN: SecureSession[0x559724af7a80]: Allocated Type:1 LSID:36940 + [1693994569.856619][73521:73521] CHIP:SC: Assigned local session key ID 36940 + [1693994569.856622][73521:73521] CHIP:SC: Waiting for PBKDF param request + [1693994569.856627][73521:73521] CHIP:DIS: Updating services using commissioning mode 1 + [1693994569.856806][73521:73521] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994569.857035][73521:73521] CHIP:DL: Using wifi MAC for hostname + [1693994569.857067][73521:73521] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=177 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 60: DAC Test Vector: Certificate validity period starts in the + future" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_valid_in_future/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994108.296043][73284:73284] CHIP:DMG: } + [1693994108.296046][73284:73284] CHIP:DMG: + [1693994108.296060][73284:73284] CHIP:EM: <<< [E:21442r S:39030 M:264066648 (Ack:200959608)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994108.296069][73284:73284] CHIP:IN: (S) Sending msg 264066648 on secure session with LSID: 39030 + [1693994108.296124][73284:73284] CHIP:DMG: Command handler moving to [CommandSen] + [1693994108.296128][73284:73284] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994108.296134][73284:73284] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994108.296138][73284:73284] CHIP:SVR: Failsafe timer expired + [1693994108.296144][73284:73284] CHIP:IN: SecureSession[0x55acb0510890]: MarkForEviction Type:1 LSID:39030 + [1693994108.296151][73284:73284] CHIP:SC: SecureSession[0x55acb0510890, LSID:39030]: State change 'kActive' --> 'kPendingEviction' + [1693994108.296179][73284:73284] CHIP:IN: SecureSession[0x55acb0510890]: Released - Type:1 LSID:39030 + [1693994108.296210][73284:73284] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994108.296234][73284:73284] CHIP:IN: SecureSession[0x55acb0510890]: Allocated Type:1 LSID:39032 + [1693994108.296238][73284:73284] CHIP:SC: Assigned local session key ID 39032 + [1693994108.296242][73284:73284] CHIP:SC: Waiting for PBKDF param request + [1693994108.296246][73284:73284] CHIP:DIS: Updating services using commissioning mode 1 + [1693994108.296462][73284:73284] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994108.296707][73284:73284] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 61: CD Test Vector: The certificate_id field has wrong length." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cert_id_len_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997320.814609][74644:74644] CHIP:EM: <<< [E:6007r S:62708 M:225968513 (Ack:186887405)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997320.814615][74644:74644] CHIP:IN: (S) Sending msg 225968513 on secure session with LSID: 62708 + [1693997320.814643][74644:74644] CHIP:DMG: Command handler moving to [CommandSen] + [1693997320.814647][74644:74644] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997320.814652][74644:74644] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997320.814655][74644:74644] CHIP:SVR: Failsafe timer expired + [1693997320.814657][74644:74644] CHIP:IN: SecureSession[0x55dfa19ceae0]: MarkForEviction Type:1 LSID:62708 + [1693997320.814661][74644:74644] CHIP:SC: SecureSession[0x55dfa19ceae0, LSID:62708]: State change 'kActive' --> 'kPendingEviction' + [1693997320.814672][74644:74644] CHIP:IN: SecureSession[0x55dfa19ceae0]: Released - Type:1 LSID:62708 + [1693997320.814680][74644:74644] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997320.814695][74644:74644] CHIP:IN: SecureSession[0x55dfa19ceae0]: Allocated Type:1 LSID:62710 + [1693997320.814699][74644:74644] CHIP:SC: Assigned local session key ID 62710 + [1693997320.814702][74644:74644] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 62: PAI Test Vector: Certificate Basic Constraint extension + PathLen field presence is wrong (present for DAC not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_pathlen_presence_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995197.902283][73788:73788] CHIP:EM: <<< [E:1271r S:60164 M:123351731 (Ack:124474473)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995197.902291][73788:73788] CHIP:IN: (S) Sending msg 123351731 on secure session with LSID: 60164 + [1693995197.902328][73788:73788] CHIP:DMG: Command handler moving to [CommandSen] + [1693995197.902332][73788:73788] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995197.902340][73788:73788] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995197.902345][73788:73788] CHIP:SVR: Failsafe timer expired + [1693995197.902348][73788:73788] CHIP:IN: SecureSession[0x5640a74d9890]: MarkForEviction Type:1 LSID:60164 + [1693995197.902353][73788:73788] CHIP:SC: SecureSession[0x5640a74d9890, LSID:60164]: State change 'kActive' --> 'kPendingEviction' + [1693995197.902369][73788:73788] CHIP:IN: SecureSession[0x5640a74d9890]: Released - Type:1 LSID:60164 + [1693995197.902380][73788:73788] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995197.902399][73788:73788] CHIP:IN: SecureSession[0x5640a74d9890]: Allocated Type:1 LSID:60166 + [1693995197.902406][73788:73788] CHIP:SC: Assigned local session key ID 60166 + [1693995197.902411][73788:73788] CHIP:SC: Waiting for PBKDF param request + [1693995197.902420][73788:73788] CHIP:DIS: Updating services using commissioning mode 1 + [1693995197.902658][73788:73788] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995197.902955][73788:73788] CHIP:DL: Using wifi MAC for hostname + [1693995197.903011][73788:73788] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 63: PAI Test Vector: Fallback VID and PID encoding example: + invalid VID prefix" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_13/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995319.932069][73870:73870] CHIP:EM: <<< [E:61482r S:22710 M:111317237 (Ack:118801789)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995319.932084][73870:73870] CHIP:IN: (S) Sending msg 111317237 on secure session with LSID: 22710 + [1693995319.932197][73870:73870] CHIP:DMG: Command handler moving to [CommandSen] + [1693995319.932207][73870:73870] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995319.932227][73870:73870] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995319.932236][73870:73870] CHIP:SVR: Failsafe timer expired + [1693995319.932240][73870:73870] CHIP:IN: SecureSession[0x5628acd36a70]: MarkForEviction Type:1 LSID:22710 + [1693995319.932244][73870:73870] CHIP:SC: SecureSession[0x5628acd36a70, LSID:22710]: State change 'kActive' --> 'kPendingEviction' + [1693995319.932273][73870:73870] CHIP:IN: SecureSession[0x5628acd36a70]: Released - Type:1 LSID:22710 + [1693995319.932291][73870:73870] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995319.932320][73870:73870] CHIP:IN: SecureSession[0x5628acd36a70]: Allocated Type:1 LSID:22712 + [1693995319.932325][73870:73870] CHIP:SC: Assigned local session key ID 22712 + [1693995319.932328][73870:73870] CHIP:SC: Waiting for PBKDF param request + [1693995319.932333][73870:73870] CHIP:DIS: Updating services using commissioning mode 1 + [1693995319.932613][73870:73870] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995319.932916][73870:73870] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: "Step 64: CD Test Vector: Invalid CMS version set to v2." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_v2/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997461.745027][74710:74710] CHIP:EM: <<< [E:51312r S:62341 M:262208603 (Ack:254470721)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997461.745033][74710:74710] CHIP:IN: (S) Sending msg 262208603 on secure session with LSID: 62341 + [1693997461.745052][74710:74710] CHIP:DMG: Command handler moving to [CommandSen] + [1693997461.745055][74710:74710] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997461.745059][74710:74710] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997461.745062][74710:74710] CHIP:SVR: Failsafe timer expired + [1693997461.745065][74710:74710] CHIP:IN: SecureSession[0x55a662f12d40]: MarkForEviction Type:1 LSID:62341 + [1693997461.745068][74710:74710] CHIP:SC: SecureSession[0x55a662f12d40, LSID:62341]: State change 'kActive' --> 'kPendingEviction' + [1693997461.745079][74710:74710] CHIP:IN: SecureSession[0x55a662f12d40]: Released - Type:1 LSID:62341 + [1693997461.745085][74710:74710] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997461.745098][74710:74710] CHIP:IN: SecureSession[0x55a662f12d40]: Allocated Type:1 LSID:62343 + [1693997461.745102][74710:74710] CHIP:SC: Assigned local session key ID 62343 + [1693997461.745105][74710:74710] CHIP:SC: Waiting for PBKDF param request + [1693997461.745109][74710:74710] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 65: DAC Test Vector: Fallback VID and PID encoding example: + invalid VID encoding" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_14/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995817.508655][74000:74000] CHIP:EM: <<< [E:7012r S:58652 M:202734303 (Ack:196860855)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995817.508663][74000:74000] CHIP:IN: (S) Sending msg 202734303 on secure session with LSID: 58652 + [1693995817.508694][74000:74000] CHIP:DMG: Command handler moving to [CommandSen] + [1693995817.508698][74000:74000] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995817.508706][74000:74000] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995817.508710][74000:74000] CHIP:SVR: Failsafe timer expired + [1693995817.508714][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: MarkForEviction Type:1 LSID:58652 + [1693995817.508718][74000:74000] CHIP:SC: SecureSession[0x55963a9cecb0, LSID:58652]: State change 'kActive' --> 'kPendingEviction' + [1693995817.508735][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: Released - Type:1 LSID:58652 + [1693995817.508745][74000:74000] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995817.508764][74000:74000] CHIP:IN: SecureSession[0x55963a9cecb0]: Allocated Type:1 LSID:58654 + [1693995817.508771][74000:74000] CHIP:SC: Assigned local session key ID 58654 + [1693995817.508775][74000:74000] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: "Step 66: CD Test Vector: The security_level field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_security_level_missing/test_case_vector.json --product-id 32768 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693986541.596701][71746:71746] CHIP:EM: <<< [E:37957r S:22144 M:175902201 (Ack:200093104)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693986541.596707][71746:71746] CHIP:IN: (S) Sending msg 175902201 on secure session with LSID: 22144 + [1693986541.596726][71746:71746] CHIP:DMG: Command handler moving to [CommandSen] + [1693986541.596728][71746:71746] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693986541.596732][71746:71746] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693986541.596735][71746:71746] CHIP:SVR: Failsafe timer expired + [1693986541.596738][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: MarkForEviction Type:1 LSID:22144 + [1693986541.596742][71746:71746] CHIP:SC: SecureSession[0x559a84d3cb20, LSID:22144]: State change 'kActive' --> 'kPendingEviction' + [1693986541.596755][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: Released - Type:1 LSID:22144 + [1693986541.596763][71746:71746] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693986541.596778][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: Allocated Type:1 LSID:22146 + disabled: true + + - label: + "Step 67: DAC Test Vector: Certificate doesnt include Key Usage + extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_security_level_missing/test_case_vector.json --product-id 32768 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693986541.596701][71746:71746] CHIP:EM: <<< [E:37957r S:22144 M:175902201 (Ack:200093104)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693986541.596707][71746:71746] CHIP:IN: (S) Sending msg 175902201 on secure session with LSID: 22144 + [1693986541.596726][71746:71746] CHIP:DMG: Command handler moving to [CommandSen] + [1693986541.596728][71746:71746] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693986541.596732][71746:71746] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693986541.596735][71746:71746] CHIP:SVR: Failsafe timer expired + [1693986541.596738][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: MarkForEviction Type:1 LSID:22144 + [1693986541.596742][71746:71746] CHIP:SC: SecureSession[0x559a84d3cb20, LSID:22144]: State change 'kActive' --> 'kPendingEviction' + [1693986541.596755][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: Released - Type:1 LSID:22144 + [1693986541.596763][71746:71746] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693986541.596778][71746:71746] CHIP:IN: SecureSession[0x559a84d3cb20]: Allocated Type:1 LSID:22146 + disabled: true + + - label: + "Step 68: PAI Test Vector: Certificate Basic Constraint extension CA + field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_ca_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997563.549737][74762:74762] CHIP:EM: <<< [E:15206r S:63028 M:93417935 (Ack:71293345)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997563.549743][74762:74762] CHIP:IN: (S) Sending msg 93417935 on secure session with LSID: 63028 + [1693997563.549766][74762:74762] CHIP:DMG: Command handler moving to [CommandSen] + [1693997563.549770][74762:74762] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997563.549776][74762:74762] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997563.549780][74762:74762] CHIP:SVR: Failsafe timer expired + [1693997563.549783][74762:74762] CHIP:IN: SecureSession[0x555e1432ca90]: MarkForEviction Type:1 LSID:63028 + [1693997563.549787][74762:74762] CHIP:SC: SecureSession[0x555e1432ca90, LSID:63028]: State change 'kActive' --> 'kPendingEviction' + [1693997563.549804][74762:74762] CHIP:IN: SecureSession[0x555e1432ca90]: Released - Type:1 LSID:63028 + [1693997563.549814][74762:74762] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997563.549831][74762:74762] CHIP:IN: SecureSession[0x555e1432ca90]: Allocated Type:1 LSID:63030 + [1693997563.549838][74762:74762] CHIP:SC: Assigned local session key ID 63030 + [1693997563.549842][74762:74762] CHIP:SC: Waiting for PBKDF param request + [1693997563.549849][74762:74762] CHIP:DIS: Updating services using commissioning mode 1 + [1693997563.550099][74762:74762] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693997563.550377][74762:74762] CHIP:DL: Using wifi MAC for hostname + [1693997563.550423][74762:74762] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: "Step 69: CD Test Vector: Invalid format_version field set to 2." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_format_version_2/test_case_vector.json --product-id 32768 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997298.963569][74629:74629] CHIP:EM: <<< [E:22186r S:49877 M:136149078 (Ack:129406676)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997298.963577][74629:74629] CHIP:IN: (S) Sending msg 136149078 on secure session with LSID: 49877 + [1693997298.963633][74629:74629] CHIP:DMG: Command handler moving to [CommandSen] + [1693997298.963638][74629:74629] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997298.963651][74629:74629] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997298.963659][74629:74629] CHIP:SVR: Failsafe timer expired + [1693997298.963663][74629:74629] CHIP:IN: SecureSession[0x5569a41b1b30]: MarkForEviction Type:1 LSID:49877 + [1693997298.963668][74629:74629] CHIP:SC: SecureSession[0x5569a41b1b30, LSID:49877]: State change 'kActive' --> 'kPendingEviction' + [1693997298.963688][74629:74629] CHIP:IN: SecureSession[0x5569a41b1b30]: Released - Type:1 LSID:49877 + [1693997298.963697][74629:74629] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997298.963714][74629:74629] CHIP:IN: SecureSession[0x5569a41b1b30]: Allocated Type:1 LSID:49879 + [1693997298.963720][74629:74629] CHIP:SC: Assigned local session key ID 49879 + disabled: true + + - label: + "Step 70: PAI Test Vector: Fallback VID and PID encoding example: + invalid, PID not present and VID not upper case" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_12/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + 1693994014.916528][73235:73235] CHIP:EM: <<< [E:30765r S:52283 M:265344393 (Ack:94964163)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994014.916537][73235:73235] CHIP:IN: (S) Sending msg 265344393 on secure session with LSID: 52283 + [1693994014.916606][73235:73235] CHIP:DMG: Command handler moving to [CommandSen] + [1693994014.916614][73235:73235] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994014.916629][73235:73235] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994014.916637][73235:73235] CHIP:SVR: Failsafe timer expired + [1693994014.916641][73235:73235] CHIP:IN: SecureSession[0x5576f0462890]: MarkForEviction Type:1 LSID:52283 + [1693994014.916648][73235:73235] CHIP:SC: SecureSession[0x5576f0462890, LSID:52283]: State change 'kActive' --> 'kPendingEviction' + [1693994014.916675][73235:73235] CHIP:IN: SecureSession[0x5576f0462890]: Released - Type:1 LSID:52283 + [1693994014.916695][73235:73235] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994014.916737][73235:73235] CHIP:IN: SecureSession[0x5576f0462890]: Allocated Type:1 LSID:52285 + [1693994014.916747][73235:73235] CHIP:SC: Assigned local session key ID 52285 + [1693994014.916754][73235:73235] CHIP:SC: Waiting for PBKDF param request + [1693994014.916776][73235:73235] CHIP:DIS: Updating services using commissioning mode 1 + [1693994014.917257][73235:73235] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994014.917585][73235:73235] CHIP:DL: Using wifi MAC for hostname + [1693994014.917633][73235:73235] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=177 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 71: PAI Test Vector: Certificate doesnt include Authority Key ID + (AKID) extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_akid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997030.811923][74498:74498] CHIP:EM: <<< [E:3545r S:12633 M:143314976 (Ack:95689146)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997030.811928][74498:74498] CHIP:IN: (S) Sending msg 143314976 on secure session with LSID: 12633 + [1693997030.811948][74498:74498] CHIP:DMG: Command handler moving to [CommandSen] + [1693997030.811951][74498:74498] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997030.811956][74498:74498] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997030.811959][74498:74498] CHIP:SVR: Failsafe timer expired + [1693997030.811961][74498:74498] CHIP:IN: SecureSession[0x561a7a305990]: MarkForEviction Type:1 LSID:12633 + [1693997030.811964][74498:74498] CHIP:SC: SecureSession[0x561a7a305990, LSID:12633]: State change 'kActive' --> 'kPendingEviction' + [1693997030.811976][74498:74498] CHIP:IN: SecureSession[0x561a7a305990]: Released - Type:1 LSID:12633 + [1693997030.811983][74498:74498] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997030.811996][74498:74498] CHIP:IN: SecureSession[0x561a7a305990]: Allocated Type:1 LSID:12635 + [1693997030.812000][74498:74498] CHIP:SC: Assigned local session key ID 12635 + disabled: true + + - label: "Step 72: CD Test Vector: The certification_type field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cert_type_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995881.963711][74025:74025] CHIP:EM: <<< [E:25552r S:14686 M:144254657 (Ack:235871460)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995881.963723][74025:74025] CHIP:IN: (S) Sending msg 144254657 on secure session with LSID: 14686 + [1693995881.963763][74025:74025] CHIP:DMG: Command handler moving to [CommandSen] + [1693995881.963769][74025:74025] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995881.963777][74025:74025] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995881.963781][74025:74025] CHIP:SVR: Failsafe timer expired + [1693995881.963784][74025:74025] CHIP:IN: SecureSession[0x55bd8b92ec90]: MarkForEviction Type:1 LSID:14686 + [1693995881.963789][74025:74025] CHIP:SC: SecureSession[0x55bd8b92ec90, LSID:14686]: State change 'kActive' --> 'kPendingEviction' + [1693995881.963805][74025:74025] CHIP:IN: SecureSession[0x55bd8b92ec90]: Released - Type:1 LSID:14686 + [1693995881.963814][74025:74025] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995881.963830][74025:74025] CHIP:IN: SecureSession[0x55bd8b92ec90]: Allocated Type:1 LSID:14688 + [1693995881.963836][74025:74025] CHIP:SC: Assigned local session key ID 14688 + [1693995881.963839][74025:74025] CHIP:SC: Waiting for PBKDF param request + [1693995881.963848][74025:74025] CHIP:DIS: Updating services using commissioning mode 1 + [1693995881.964078][74025:74025] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995881.964378][74025:74025] CHIP:DL: Using wifi MAC for hostname + [1693995881.964421][74025:74025] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 73: PAI Test Vector: VID in Subject field doesnt match VID in + Issuer field" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_subject_vid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995066.552263][73733:73733] CHIP:EM: <<< [E:28752r S:56050 M:91395672 (Ack:28019124)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995066.552269][73733:73733] CHIP:IN: (S) Sending msg 91395672 on secure session with LSID: 56050 + [1693995066.552288][73733:73733] CHIP:DMG: Command handler moving to [CommandSen] + [1693995066.552291][73733:73733] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995066.552295][73733:73733] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995066.552297][73733:73733] CHIP:SVR: Failsafe timer expired + [1693995066.552300][73733:73733] CHIP:IN: SecureSession[0x55e35e55fc30]: MarkForEviction Type:1 LSID:56050 + [1693995066.552303][73733:73733] CHIP:SC: SecureSession[0x55e35e55fc30, LSID:56050]: State change 'kActive' --> 'kPendingEviction' + [1693995066.552314][73733:73733] CHIP:IN: SecureSession[0x55e35e55fc30]: Released - Type:1 LSID:56050 + [1693995066.552322][73733:73733] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995066.552335][73733:73733] CHIP:IN: SecureSession[0x55e35e55fc30]: Allocated Type:1 LSID:56052 + [1693995066.552340][73733:73733] CHIP:SC: Assigned local session key ID 56052 + [1693995066.552342][73733:73733] CHIP:SC: Waiting for PBKDF param request + [1693995066.552348][73733:73733] CHIP:DIS: Updating services using commissioning mode 1 + [1693995066.552571][73733:73733] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995066.552808][73733:73733] CHIP:DL: Using wifi MAC for hostname + [1693995066.552843][73733:73733] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693995066.552854][73733:73733] CHIP:DIS: Responding with _matterc._udp.l + disabled: true + + - label: + "Step 74: DAC Test Vector: Certificate Key Usage extension critical + field is set as 'non-critical'" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_key_usage_critical_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993286.456667][72701:72701] CHIP:IN: (S) Sending msg 164594174 on secure session with LSID: 42108 + [1693993286.456731][72701:72701] CHIP:DMG: Command handler moving to [CommandSen] + [1693993286.456737][72701:72701] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993286.456747][72701:72701] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993286.456753][72701:72701] CHIP:SVR: Failsafe timer expired + [1693993286.456758][72701:72701] CHIP:IN: SecureSession[0x559be703da30]: MarkForEviction Type:1 LSID:42108 + [1693993286.456764][72701:72701] CHIP:SC: SecureSession[0x559be703da30, LSID:42108]: State change 'kActive' --> 'kPendingEviction' + [1693993286.456791][72701:72701] CHIP:IN: SecureSession[0x559be703da30]: Released - Type:1 LSID:42108 + [1693993286.456810][72701:72701] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993286.456845][72701:72701] CHIP:IN: SecureSession[0x559be703da30]: Allocated Type:1 LSID:42110 + [1693993286.456852][72701:72701] CHIP:SC: Assigned local session key ID 42110 + [1693993286.456857][72701:72701] CHIP:SC: Waiting for PBKDF param request + [1693993286.456868][72701:72701] CHIP:DIS: Updating services using commissioning mode 1 + [1693993286.457360][72701:72701] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993286.457672][72701:72701] CHIP:DL: Using wifi MAC for hostname + [1693993286.457715][72701:72701] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693993286.457726][72701:72701] CHIP:DIS: Responding with _matterc._udp.local + disabled: true + + - label: + "Step 75: DAC Test Vector: Fallback VID and PID encoding example from + spec: invalid, since substring following Mpid: is not exactly 4 + uppercase hexadecimal digits" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_09/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995260.012915][73834:73834] CHIP:DMG: + [1693995260.012926][73834:73834] CHIP:EM: <<< [E:60855r S:8080 M:251599612 (Ack:56465607)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995260.012933][73834:73834] CHIP:IN: (S) Sending msg 251599612 on secure session with LSID: 8080 + [1693995260.012973][73834:73834] CHIP:DMG: Command handler moving to [CommandSen] + [1693995260.012978][73834:73834] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995260.012984][73834:73834] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995260.012987][73834:73834] CHIP:SVR: Failsafe timer expired + [1693995260.012991][73834:73834] CHIP:IN: SecureSession[0x560f3897d3b0]: MarkForEviction Type:1 LSID:8080 + [1693995260.012996][73834:73834] CHIP:SC: SecureSession[0x560f3897d3b0, LSID:8080]: State change 'kActive' --> 'kPendingEviction' + [1693995260.013011][73834:73834] CHIP:IN: SecureSession[0x560f3897d3b0]: Released - Type:1 LSID:8080 + [1693995260.013020][73834:73834] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995260.013036][73834:73834] CHIP:IN: SecureSession[0x560f3897d3b0]: Allocated Type:1 LSID:8082 + [1693995260.013042][73834:73834] CHIP:SC: Assigned local session key ID 8082 + [1693995260.013046][73834:73834] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 76: DAC Test Vector: Certificate doesnt include Basic Constraint + extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995791.207188][73985:73985] CHIP:EM: <<< [E:46317r S:59509 M:225538799 (Ack:100515880)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995791.207194][73985:73985] CHIP:IN: (S) Sending msg 225538799 on secure session with LSID: 59509 + [1693995791.207215][73985:73985] CHIP:DMG: Command handler moving to [CommandSen] + [1693995791.207218][73985:73985] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995791.207224][73985:73985] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995791.207227][73985:73985] CHIP:SVR: Failsafe timer expired + [1693995791.207230][73985:73985] CHIP:IN: SecureSession[0x5639d72d76b0]: MarkForEviction Type:1 LSID:59509 + [1693995791.207234][73985:73985] CHIP:SC: SecureSession[0x5639d72d76b0, LSID:59509]: State change 'kActive' --> 'kPendingEviction' + [1693995791.207247][73985:73985] CHIP:IN: SecureSession[0x5639d72d76b0]: Released - Type:1 LSID:59509 + [1693995791.207255][73985:73985] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995791.207271][73985:73985] CHIP:IN: SecureSession[0x5639d72d76b0]: Allocated Type:1 LSID:59511 + [1693995791.207276][73985:73985] CHIP:SC: Assigned local session key ID 59511 + [1693995791.207279][73985:73985] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 77: CD Test Vector: The dac_origin_vendor_id fild is not present + and dac_origin_product_id is present." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_missing_pid_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993506.668073][72775:72775] CHIP:EM: <<< [E:43761r S:6870 M:126288958 (Ack:38007872)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993506.668080][72775:72775] CHIP:IN: (S) Sending msg 126288958 on secure session with LSID: 6870 + [1693993506.668109][72775:72775] CHIP:DMG: Command handler moving to [CommandSen] + [1693993506.668113][72775:72775] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993506.668119][72775:72775] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993506.668124][72775:72775] CHIP:SVR: Failsafe timer expired + [1693993506.668127][72775:72775] CHIP:IN: SecureSession[0x5557c35e8940]: MarkForEviction Type:1 LSID:6870 + [1693993506.668131][72775:72775] CHIP:SC: SecureSession[0x5557c35e8940, LSID:6870]: State change 'kActive' --> 'kPendingEviction' + [1693993506.668147][72775:72775] CHIP:IN: SecureSession[0x5557c35e8940]: Released - Type:1 LSID:6870 + [1693993506.668156][72775:72775] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993506.668174][72775:72775] CHIP:IN: SecureSession[0x5557c35e8940]: Allocated Type:1 LSID:6872 + [1693993506.668180][72775:72775] CHIP:SC: Assigned local session key ID 6872 + [1693993506.668184][72775:72775] CHIP:SC: Waiting for PBKDF param request + [1693993506.668192][72775:72775] CHIP:DIS: Updating services using commissioning mode 1 + [1693993506.668443][72775:72775] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993506.668725][72775:72775] CHIP:DL: Using wifi MAC for hostname + [1693993506.668758][72775:72775] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693993506.668768][72775:72775] CHIP:DIS: Responding with _matterc._udp.local + [1693993506.668771][72775:72775] CHIP:DIS: Responding with 5F5CFF56D4D1B826._matterc._udp.local + disabled: true + + - label: + "Step 78: CD Test Vector: The authorized_paa_list contains ten PAAs + none of which is a valid PAA authorized to sign the PAI." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count10_invalid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994966.391444][73695:73695] CHIP:EM: <<< [E:62607r S:61961 M:184105458 (Ack:71570764)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994966.391451][73695:73695] CHIP:IN: (S) Sending msg 184105458 on secure session with LSID: 61961 + [1693994966.391482][73695:73695] CHIP:DMG: Command handler moving to [CommandSen] + [1693994966.391485][73695:73695] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994966.391492][73695:73695] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994966.391496][73695:73695] CHIP:SVR: Failsafe timer expired + [1693994966.391498][73695:73695] CHIP:IN: SecureSession[0x56426b169920]: MarkForEviction Type:1 LSID:61961 + [1693994966.391502][73695:73695] CHIP:SC: SecureSession[0x56426b169920, LSID:61961]: State change 'kActive' --> 'kPendingEviction' + [1693994966.391515][73695:73695] CHIP:IN: SecureSession[0x56426b169920]: Released - Type:1 LSID:61961 + [1693994966.391523][73695:73695] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994966.391538][73695:73695] CHIP:IN: SecureSession[0x56426b169920]: Allocated Type:1 LSID:61963 + [1693994966.391544][73695:73695] CHIP:SC: Assigned local session key ID 61963 + [1693994966.391547][73695:73695] CHIP:SC: Waiting for PBKDF param request + [1693994966.391553][73695:73695] CHIP:DIS: Updating services using commissioning mode 1 + [1693994966.391757][73695:73695] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994966.391995][73695:73695] CHIP:DL: Using wifi MAC for hostname + [1693994966.392035][73695:73695] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 79: PAI Test Vector: Certificate doesnt include Subject Key ID + (SKID) extension" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_skid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1694000205.966896][75316:75316] CHIP:EM: <<< [E:53246r S:10676 M:42258398 (Ack:58149456)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1694000205.966905][75316:75316] CHIP:IN: (S) Sending msg 42258398 on secure session with LSID: 10676 + [1694000205.966934][75316:75316] CHIP:DMG: Command handler moving to [CommandSen] + [1694000205.966937][75316:75316] CHIP:DMG: Command handler moving to [AwaitingDe] + [1694000205.966943][75316:75316] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1694000205.966947][75316:75316] CHIP:SVR: Failsafe timer expired + [1694000205.966951][75316:75316] CHIP:IN: SecureSession[0x5593424d2bc0]: MarkForEviction Type:1 LSID:10676 + [1694000205.966955][75316:75316] CHIP:SC: SecureSession[0x5593424d2bc0, LSID:10676]: State change 'kActive' --> 'kPendingEviction' + [1694000205.966973][75316:75316] CHIP:IN: SecureSession[0x5593424d2bc0]: Released - Type:1 LSID:10676 + [1694000205.966984][75316:75316] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1694000205.967003][75316:75316] CHIP:IN: SecureSession[0x5593424d2bc0]: Allocated Type:1 LSID:10678 + [1694000205.967008][75316:75316] CHIP:SC: Assigned local session key ID 10678 + [1694000205.967013][75316:75316] CHIP:SC: Waiting for PBKDF param request + [1694000205.967020][75316:75316] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 80: PAA Test Vector: Use Invalid PAA (Not Registered in the + DCL)." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/invalid_paa/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995967.899266][74064:74064] CHIP:EM: <<< [E:64536r S:43313 M:255762469 (Ack:183956987)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995967.899272][74064:74064] CHIP:IN: (S) Sending msg 255762469 on secure session with LSID: 43313 + [1693995967.899293][74064:74064] CHIP:DMG: Command handler moving to [CommandSen] + [1693995967.899296][74064:74064] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995967.899301][74064:74064] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995967.899304][74064:74064] CHIP:SVR: Failsafe timer expired + [1693995967.899307][74064:74064] CHIP:IN: SecureSession[0x55cc2c7db970]: MarkForEviction Type:1 LSID:43313 + [1693995967.899312][74064:74064] CHIP:SC: SecureSession[0x55cc2c7db970, LSID:43313]: State change 'kActive' --> 'kPendingEviction' + [1693995967.899326][74064:74064] CHIP:IN: SecureSession[0x55cc2c7db970]: Released - Type:1 LSID:43313 + [1693995967.899334][74064:74064] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995967.899348][74064:74064] CHIP:IN: SecureSession[0x55cc2c7db970]: Allocated Type:1 LSID:43315 + [1693995967.899353][74064:74064] CHIP:SC: Assigned local session key ID 43315 + disabled: true + + - label: + "Step 81: DAC Test Vector: Certificate Basic Constraint extension + PathLen field presence is wrong (present for DAC not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_pathlen_presence_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994441.928228][73474:73474] CHIP:DMG: } + [1693994441.928231][73474:73474] CHIP:DMG: + [1693994441.928254][73474:73474] CHIP:EM: <<< [E:59402r S:246 M:229095428 (Ack:35299346)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994441.928265][73474:73474] CHIP:IN: (S) Sending msg 229095428 on secure session with LSID: 246 + [1693994441.928323][73474:73474] CHIP:DMG: Command handler moving to [CommandSen] + [1693994441.928327][73474:73474] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994441.928339][73474:73474] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994441.928344][73474:73474] CHIP:SVR: Failsafe timer expired + [1693994441.928349][73474:73474] CHIP:IN: SecureSession[0x563a2d9b2890]: MarkForEviction Type:1 LSID:246 + [1693994441.928354][73474:73474] CHIP:SC: SecureSession[0x563a2d9b2890, LSID:246]: State change 'kActive' --> 'kPendingEviction' + [1693994441.928372][73474:73474] CHIP:IN: SecureSession[0x563a2d9b2890]: Released - Type:1 LSID:246 + [1693994441.928381][73474:73474] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994441.928400][73474:73474] CHIP:IN: SecureSession[0x563a2d9b2890]: Allocated Type:1 LSID:248 + [1693994441.928406][73474:73474] CHIP:SC: Assigned local session key ID 248 + [1693994441.928409][73474:73474] CHIP:SC: Waiting for PBKDF param request + [1693994441.928416][73474:73474] CHIP:DIS: Updating services using commissioning mode 1 + [1693994441.928637][73474:73474] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994441.928900][73474:73474] CHIP:DL: Using wifi MAC for hostname + [1693994441.928934][73474:73474] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693994441.928947][73474:73474] CHIP:DIS: Responding with _matterc._udp.local + [1693994441.928961][73474:73474] CHIP:DIS: Responding with 3E01EDD4BC3C2AF9._matterc._udp.local + [1693994441.928964][73474:73474] CHIP:DIS: Responding with 8C1D96786A130000.local + disabled: true + + - label: + "Step 82: DAC Test Vector: Mix of Fallback and Matter OID encoding for + VID and PID: invalid, PID is using Matter OID then VID must also use + Matter OID" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_17/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996905.702758][74442:74442] CHIP:EM: <<< [E:7107r S:18979 M:236270845 (Ack:85054530)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996905.702764][74442:74442] CHIP:IN: (S) Sending msg 236270845 on secure session with LSID: 18979 + [1693996905.702788][74442:74442] CHIP:DMG: Command handler moving to [CommandSen] + [1693996905.702791][74442:74442] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996905.702796][74442:74442] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996905.702799][74442:74442] CHIP:SVR: Failsafe timer expired + [1693996905.702802][74442:74442] CHIP:IN: SecureSession[0x56288c350990]: MarkForEviction Type:1 LSID:18979 + [1693996905.702807][74442:74442] CHIP:SC: SecureSession[0x56288c350990, LSID:18979]: State change 'kActive' --> 'kPendingEviction' + [1693996905.702820][74442:74442] CHIP:IN: SecureSession[0x56288c350990]: Released - Type:1 LSID:18979 + [1693996905.702828][74442:74442] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996905.702842][74442:74442] CHIP:IN: SecureSession[0x56288c350990]: Allocated Type:1 LSID:18981 + [1693996905.702847][74442:74442] CHIP:SC: Assigned local session key ID 18981 + [1693996905.702851][74442:74442] CHIP:SC: Waiting for PBKDF param request + disabled: true + + - label: + "Step 83: DAC Test Vector: Certificate Basic Constraint extension CA + field is missing" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_ca_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + [1693993614.289279][72826:72826] CHIP:EM: <<< [E:11915r S:25559 M:123399583 (Ack:174738663)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993614.289287][72826:72826] CHIP:IN: (S) Sending msg 123399583 on secure session with LSID: 25559 + [1693993614.289310][72826:72826] CHIP:DMG: Command handler moving to [CommandSen] + [1693993614.289313][72826:72826] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993614.289317][72826:72826] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993614.289321][72826:72826] CHIP:SVR: Failsafe timer expired + [1693993614.289324][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: MarkForEviction Type:1 LSID:25559 + [1693993614.289329][72826:72826] CHIP:SC: SecureSession[0x5585eb32ab80, LSID:25559]: State change 'kActive' --> 'kPendingEviction' + [1693993614.289344][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: Released - Type:1 LSID:25559 + [1693993614.289352][72826:72826] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993614.289370][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: Allocated Type:1 LSID:25561 + [1693993614.289375][72826:72826] CHIP:SC: Assigned local session key ID 25561 + [1693993614.289379][72826:72826] CHIP:SC: Waiting for PBKDF param request + [1693993614.289386][72826:72826] CHIP:DIS: Updating services using commissioning mode 1 + [1693993614.289637][72826:72826] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993614.289931][72826:72826] CHIP:DL: Using wifi MAC for hostname + [1693993614.289970][72826:72826] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: + "Step 84: DAC Test Vector: Certificate Key Usage extension cRLSign + field is wrong (present for DAC and not present for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_key_usage_crl_sign_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997175.066400][74569:74569] CHIP:EM: <<< [E:49203r S:4076 M:82722507 (Ack:43979047)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997175.066406][74569:74569] CHIP:IN: (S) Sending msg 82722507 on secure session with LSID: 4076 + [1693997175.066434][74569:74569] CHIP:DMG: Command handler moving to [CommandSen] + [1693997175.066438][74569:74569] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997175.066445][74569:74569] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997175.066450][74569:74569] CHIP:SVR: Failsafe timer expired + [1693997175.066453][74569:74569] CHIP:IN: SecureSession[0x55b6ecc239a0]: MarkForEviction Type:1 LSID:4076 + [1693997175.066457][74569:74569] CHIP:SC: SecureSession[0x55b6ecc239a0, LSID:4076]: State change 'kActive' --> 'kPendingEviction' + [1693997175.066473][74569:74569] CHIP:IN: SecureSession[0x55b6ecc239a0]: Released - Type:1 LSID:4076 + [1693997175.066481][74569:74569] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997175.066500][74569:74569] CHIP:IN: SecureSession[0x55b6ecc239a0]: Allocated Type:1 LSID:4078 + [1693997175.066507][74569:74569] CHIP:SC: Assigned local session key ID 4078 + [1693997175.066511][74569:74569] CHIP:SC: Waiting for PBKDF param request + [1693997175.066518][74569:74569] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: + "Step 85: DAC Test Vector: Certificate Basic Constraint extension + PathLen field set to 1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_basic_pathlen1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993543.391045][72792:72792] CHIP:EM: <<< [E:27543r S:37975 M:106997663 (Ack:16093275)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993543.391050][72792:72792] CHIP:IN: (S) Sending msg 106997663 on secure session with LSID: 37975 + [1693993543.391083][72792:72792] CHIP:DMG: Command handler moving to [CommandSen] + [1693993543.391086][72792:72792] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993543.391090][72792:72792] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993543.391093][72792:72792] CHIP:SVR: Failsafe timer expired + [1693993543.391095][72792:72792] CHIP:IN: SecureSession[0x55cc9deb9c60]: MarkForEviction Type:1 LSID:37975 + [1693993543.391098][72792:72792] CHIP:SC: SecureSession[0x55cc9deb9c60, LSID:37975]: State change 'kActive' --> 'kPendingEviction' + [1693993543.391110][72792:72792] CHIP:IN: SecureSession[0x55cc9deb9c60]: Released - Type:1 LSID:37975 + [1693993543.391117][72792:72792] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993543.391131][72792:72792] CHIP:IN: SecureSession[0x55cc9deb9c60]: Allocated Type:1 LSID:37977 + [1693993543.391135][72792:72792] CHIP:SC: Assigned local session key ID 37977 + [1693993543.391138][72792:72792] CHIP:SC: Waiting for PBKDF param request + [1693993543.391143][72792:72792] CHIP:DIS: Updating services using commissioning mode 1 + [1693993543.391335][72792:72792] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 86: DAC Test Vector: Fallback VID and PID encoding example: + invalid VID prefix" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_13/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995912.709704][74034:74034] CHIP:EM: <<< [E:38489r S:6352 M:205559533 (Ack:262506086)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995912.709712][74034:74034] CHIP:IN: (S) Sending msg 205559533 on secure session with LSID: 6352 + [1693995912.709737][74034:74034] CHIP:DMG: Command handler moving to [CommandSen] + [1693995912.709739][74034:74034] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995912.709744][74034:74034] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995912.709747][74034:74034] CHIP:SVR: Failsafe timer expired + [1693995912.709750][74034:74034] CHIP:IN: SecureSession[0x5619a3eaeea0]: MarkForEviction Type:1 LSID:6352 + [1693995912.709755][74034:74034] CHIP:SC: SecureSession[0x5619a3eaeea0, LSID:6352]: State change 'kActive' --> 'kPendingEviction' + [1693995912.709771][74034:74034] CHIP:IN: SecureSession[0x5619a3eaeea0]: Released - Type:1 LSID:6352 + [1693995912.709780][74034:74034] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995912.709797][74034:74034] CHIP:IN: SecureSession[0x5619a3eaeea0]: Allocated Type:1 LSID:6354 + [1693995912.709803][74034:74034] CHIP:SC: Assigned local session key ID 6354 + [1693995912.709806][74034:74034] CHIP:SC: Waiting for PBKDF param request + [1693995912.709814][74034:74034] CHIP:DIS: Updating services using commissioning mode 1 + [1693995912.710062][74034:74034] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995912.710352][74034:74034] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 87: DAC Test Vector: Invalid certificate version field set to + v2(1)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_cert_version_v2/test_case_vector.json --product-id 32768 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994702.874495][73568:73568] CHIP:DMG: + [1693994702.874505][73568:73568] CHIP:EM: <<< [E:48921r S:51325 M:96774311 (Ack:264729104)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994702.874510][73568:73568] CHIP:IN: (S) Sending msg 96774311 on secure session with LSID: 51325 + [1693994702.874533][73568:73568] CHIP:DMG: Command handler moving to [CommandSen] + [1693994702.874536][73568:73568] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994702.874540][73568:73568] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994702.874542][73568:73568] CHIP:SVR: Failsafe timer expired + [1693994702.874546][73568:73568] CHIP:IN: SecureSession[0x5619db2979a0]: MarkForEviction Type:1 LSID:51325 + [1693994702.874550][73568:73568] CHIP:SC: SecureSession[0x5619db2979a0, LSID:51325]: State change 'kActive' --> 'kPendingEviction' + [1693994702.874564][73568:73568] CHIP:IN: SecureSession[0x5619db2979a0]: Released - Type:1 LSID:51325 + [1693994702.874572][73568:73568] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994702.874587][73568:73568] CHIP:IN: SecureSession[0x5619db2979a0]: Allocated Type:1 LSID:51327 + [1693994702.874592][73568:73568] CHIP:SC: Assigned local session key ID 51327 + [1693994702.874595][73568:73568] CHIP:SC: Waiting for PBKDF param request + [1693994702.874603][73568:73568] CHIP:DIS: Updating services using commissioning mode 1 + [1693994702.874831][73568:73568] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 88: DAC Test Vector: VID in Subject field doesnt match VID in + Issuer field" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_subject_vid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993773.557516][72869:72869] CHIP:DMG: } + [1693993773.557518][72869:72869] CHIP:DMG: + [1693993773.557529][72869:72869] CHIP:EM: <<< [E:20914r S:10360 M:64900117 (Ack:58867763)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993773.557537][72869:72869] CHIP:IN: (S) Sending msg 64900117 on secure session with LSID: 10360 + [1693993773.557569][72869:72869] CHIP:DMG: Command handler moving to [CommandSen] + [1693993773.557573][72869:72869] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993773.557579][72869:72869] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993773.557582][72869:72869] CHIP:SVR: Failsafe timer expired + [1693993773.557585][72869:72869] CHIP:IN: SecureSession[0x565173d71a20]: MarkForEviction Type:1 LSID:10360 + [1693993773.557588][72869:72869] CHIP:SC: SecureSession[0x565173d71a20, LSID:10360]: State change 'kActive' --> 'kPendingEviction' + [1693993773.557599][72869:72869] CHIP:IN: SecureSession[0x565173d71a20]: Released - Type:1 LSID:10360 + [1693993773.557606][72869:72869] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993773.557620][72869:72869] CHIP:IN: SecureSession[0x565173d71a20]: Allocated Type:1 LSID:10362 + [1693993773.557624][72869:72869] CHIP:SC: Assigned local session key ID 10362 + [1693993773.557627][72869:72869] CHIP:SC: Waiting for PBKDF param request + [1693993773.557632][72869:72869] CHIP:DIS: Updating services using commissioning mode 1 + [1693993773.557813][72869:72869] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993773.558024][72869:72869] CHIP:DL: Using wifi MAC for hostname + [1693993773.558059][72869:72869] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + disabled: true + + - label: "Step 89: CD Test Vector: The format_version field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_format_version_missing/test_case_vector.json --product-id 32768 + + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693997210.051257][74584:74584] CHIP:EM: <<< [E:57940r S:23049 M:92365298 (Ack:236085904)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693997210.051264][74584:74584] CHIP:IN: (S) Sending msg 92365298 on secure session with LSID: 23049 + [1693997210.051294][74584:74584] CHIP:DMG: Command handler moving to [CommandSen] + [1693997210.051297][74584:74584] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693997210.051303][74584:74584] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693997210.051307][74584:74584] CHIP:SVR: Failsafe timer expired + [1693997210.051310][74584:74584] CHIP:IN: SecureSession[0x558b22f2fce0]: MarkForEviction Type:1 LSID:23049 + [1693997210.051313][74584:74584] CHIP:SC: SecureSession[0x558b22f2fce0, LSID:23049]: State change 'kActive' --> 'kPendingEviction' + [1693997210.051326][74584:74584] CHIP:IN: SecureSession[0x558b22f2fce0]: Released - Type:1 LSID:23049 + [1693997210.051334][74584:74584] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693997210.051349][74584:74584] CHIP:IN: SecureSession[0x558b22f2fce0]: Allocated Type:1 LSID:23051 + [1693997210.051354][74584:74584] CHIP:SC: Assigned local session key ID 23051 + disabled: true + + - label: "Step 90: CD Test Vector: The device_type_id field is missing." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_device_type_id_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993573.297063][72806:72806] CHIP:EM: <<< [E:28701r S:35923 M:215504152 (Ack:14384899)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993573.297071][72806:72806] CHIP:IN: (S) Sending msg 215504152 on secure session with LSID: 35923 + [1693993573.297109][72806:72806] CHIP:DMG: Command handler moving to [CommandSen] + [1693993573.297112][72806:72806] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993573.297119][72806:72806] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993573.297122][72806:72806] CHIP:SVR: Failsafe timer expired + [1693993573.297125][72806:72806] CHIP:IN: SecureSession[0x561727f72ce0]: MarkForEviction Type:1 LSID:35923 + [1693993573.297127][72806:72806] CHIP:SC: SecureSession[0x561727f72ce0, LSID:35923]: State change 'kActive' --> 'kPendingEviction' + [1693993573.297139][72806:72806] CHIP:IN: SecureSession[0x561727f72ce0]: Released - Type:1 LSID:35923 + [1693993573.297145][72806:72806] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993573.297158][72806:72806] CHIP:IN: SecureSession[0x561727f72ce0]: Allocated Type:1 LSID:35925 + [1693993573.297163][72806:72806] CHIP:SC: Assigned local session key ID 35925 + [1693993573.297165][72806:72806] CHIP:SC: Waiting for PBKDF param request + [1693993573.297172][72806:72806] CHIP:DIS: Updating services using commissioning mode 1 + [1693993573.297368][72806:72806] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693993573.297638][72806:72806] CHIP:DL: Using wifi MAC for hostname + [1693993573.297667][72806:72806] CHIP:DIS: Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 + [1693993573.297676][72806:72806] CHIP:DIS: Responding with _matterc._udp.local + disabled: true + + - label: + "Step 91: DAC Test Vector: PID in Subject field doesnt match PID in + Issuer field" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_subject_pid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693996797.931878][74392:74392] CHIP:DMG: + [1693996797.931886][74392:74392] CHIP:EM: <<< [E:52113r S:36416 M:61307417 (Ack:229885016)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693996797.931891][74392:74392] CHIP:IN: (S) Sending msg 61307417 on secure session with LSID: 36416 + [1693996797.931930][74392:74392] CHIP:DMG: Command handler moving to [CommandSen] + [1693996797.931932][74392:74392] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693996797.931937][74392:74392] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693996797.931940][74392:74392] CHIP:SVR: Failsafe timer expired + [1693996797.931942][74392:74392] CHIP:IN: SecureSession[0x55bc8f6cbc40]: MarkForEviction Type:1 LSID:36416 + [1693996797.931945][74392:74392] CHIP:SC: SecureSession[0x55bc8f6cbc40, LSID:36416]: State change 'kActive' --> 'kPendingEviction' + [1693996797.931957][74392:74392] CHIP:IN: SecureSession[0x55bc8f6cbc40]: Released - Type:1 LSID:36416 + [1693996797.931964][74392:74392] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693996797.931977][74392:74392] CHIP:IN: SecureSession[0x55bc8f6cbc40]: Allocated Type:1 LSID:36418 + [1693996797.931981][74392:74392] CHIP:SC: Assigned local session key ID 36418 + disabled: true + + - label: + "Step 92: PAI Test Vector: Certificate Basic Constraint extension CA + field is wrong (TRUE for DAC and FALSE for PAI)" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_ca_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995232.206947][73816:73816] CHIP:EM: <<< [E:17497r S:51386 M:198210726 (Ack:46150282)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995232.206956][73816:73816] CHIP:IN: (S) Sending msg 198210726 on secure session with LSID: 51386 + [1693995232.206984][73816:73816] CHIP:DMG: Command handler moving to [CommandSen] + [1693995232.206988][73816:73816] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995232.206994][73816:73816] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995232.206998][73816:73816] CHIP:SVR: Failsafe timer expired + [1693995232.207002][73816:73816] CHIP:IN: SecureSession[0x55d9850fe970]: MarkForEviction Type:1 LSID:51386 + [1693995232.207006][73816:73816] CHIP:SC: SecureSession[0x55d9850fe970, LSID:51386]: State change 'kActive' --> 'kPendingEviction' + [1693995232.207029][73816:73816] CHIP:IN: SecureSession[0x55d9850fe970]: Released - Type:1 LSID:51386 + [1693995232.207045][73816:73816] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995232.207086][73816:73816] CHIP:IN: SecureSession[0x55d9850fe970]: Allocated Type:1 LSID:51388 + [1693995232.207097][73816:73816] CHIP:SC: Assigned local session key ID 51388 + [1693995232.207101][73816:73816] CHIP:SC: Waiting for PBKDF param request + [1693995232.207113][73816:73816] CHIP:DIS: Updating services using commissioning mode 1 + [1693995232.207494][73816:73816] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693995232.207803][73816:73816] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 93: CD Test Vector: The dac_origin_vendor_id and + dac_origin_product_id fields present and the PID value doesnt match + the PID found in the DAC Subject DN." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_pid_present_pid_mismatch/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995756.487808][73971:73971] CHIP:EM: <<< [E:18472r S:904 M:103552416 (Ack:249527511)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995756.487815][73971:73971] CHIP:IN: (S) Sending msg 103552416 on secure session with LSID: 904 + [1693995756.487857][73971:73971] CHIP:DMG: Command handler moving to [CommandSen] + [1693995756.487860][73971:73971] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995756.487866][73971:73971] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995756.487869][73971:73971] CHIP:SVR: Failsafe timer expired + [1693995756.487873][73971:73971] CHIP:IN: SecureSession[0x563f4befd0a0]: MarkForEviction Type:1 LSID:904 + [1693995756.487877][73971:73971] CHIP:SC: SecureSession[0x563f4befd0a0, LSID:904]: State change 'kActive' --> 'kPendingEviction' + [1693995756.487891][73971:73971] CHIP:IN: SecureSession[0x563f4befd0a0]: Released - Type:1 LSID:904 + [1693995756.487898][73971:73971] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995756.487913][73971:73971] CHIP:IN: SecureSession[0x563f4befd0a0]: Allocated Type:1 LSID:906 + [1693995756.487919][73971:73971] CHIP:SC: Assigned local session key ID 906 + [1693995756.487922][73971:73971] CHIP:SC: Waiting for PBKDF param request + [1693995756.487928][73971:73971] CHIP:DIS: Updating services using commissioning mode 1 + [1693995756.488137][73971:73971] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: "Step 94: CD Test Vector: Invalid CMS digest algorithm SHA1." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_digest_algo_sha1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693995992.630928][74076:74076] CHIP:EM: <<< [E:17723r S:41547 M:62321273 (Ack:21047269)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995992.630935][74076:74076] CHIP:IN: (S) Sending msg 62321273 on secure session with LSID: 41547 + [1693995992.630973][74076:74076] CHIP:DMG: Command handler moving to [CommandSen] + [1693995992.630976][74076:74076] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995992.630981][74076:74076] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995992.630984][74076:74076] CHIP:SVR: Failsafe timer expired + [1693995992.630987][74076:74076] CHIP:IN: SecureSession[0x5651ac815d00]: MarkForEviction Type:1 LSID:41547 + [1693995992.630990][74076:74076] CHIP:SC: SecureSession[0x5651ac815d00, LSID:41547]: State change 'kActive' --> 'kPendingEviction' + [1693995992.631001][74076:74076] CHIP:IN: SecureSession[0x5651ac815d00]: Released - Type:1 LSID:41547 + [1693995992.631007][74076:74076] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995992.631022][74076:74076] CHIP:IN: SecureSession[0x5651ac815d00]: Allocated Type:1 LSID:41549 + [1693995992.631026][74076:74076] CHIP:SC: Assigned local session key ID 41549 + [1693995992.631029][74076:74076] CHIP:SC: Waiting for PBKDF param request + [1693995992.631034][74076:74076] CHIP:DIS: Updating services using commissioning mode 1 + disabled: true + + - label: "Step 95: CD Test Vector: Invalid CMS Signature." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_signature/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693994899.515996][73668:73668] CHIP:DMG: + [1693994899.516006][73668:73668] CHIP:EM: <<< [E:6307r S:5804 M:155066286 (Ack:201427042)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693994899.516012][73668:73668] CHIP:IN: (S) Sending msg 155066286 on secure session with LSID: 5804 + [1693994899.516034][73668:73668] CHIP:DMG: Command handler moving to [CommandSen] + [1693994899.516037][73668:73668] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693994899.516043][73668:73668] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693994899.516046][73668:73668] CHIP:SVR: Failsafe timer expired + [1693994899.516050][73668:73668] CHIP:IN: SecureSession[0x56266902eb60]: MarkForEviction Type:1 LSID:5804 + [1693994899.516054][73668:73668] CHIP:SC: SecureSession[0x56266902eb60, LSID:5804]: State change 'kActive' --> 'kPendingEviction' + [1693994899.516068][73668:73668] CHIP:IN: SecureSession[0x56266902eb60]: Released - Type:1 LSID:5804 + [1693994899.516075][73668:73668] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693994899.516090][73668:73668] CHIP:IN: SecureSession[0x56266902eb60]: Allocated Type:1 LSID:5806 + [1693994899.516095][73668:73668] CHIP:SC: Assigned local session key ID 5806 + [1693994899.516098][73668:73668] CHIP:SC: Waiting for PBKDF param request + [1693994899.516106][73668:73668] CHIP:DIS: Updating services using commissioning mode 1 + [1693994899.516366][73668:73668] CHIP:DIS: CHIP minimal mDNS started advertising. + [1693994899.516614][73668:73668] CHIP:DL: Using wifi MAC for hostname + disabled: true + + - label: + "Step 96: PAI Test Vector: Certificate Basic Constraint extension + PathLen field set to 1" + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_pathlen1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + o 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693995941.309060][74050:74050] CHIP:IN: (S) Sending msg 222865985 on secure session with LSID: 45785 + [1693995941.309108][74050:74050] CHIP:DMG: Command handler moving to [CommandSen] + [1693995941.309111][74050:74050] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693995941.309119][74050:74050] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693995941.309122][74050:74050] CHIP:SVR: Failsafe timer expired + [1693995941.309126][74050:74050] CHIP:IN: SecureSession[0x559c0bcaea80]: MarkForEviction Type:1 LSID:45785 + [1693995941.309130][74050:74050] CHIP:SC: SecureSession[0x559c0bcaea80, LSID:45785]: State change 'kActive' --> 'kPendingEviction' + [1693995941.309150][74050:74050] CHIP:IN: SecureSession[0x559c0bcaea80]: Released - Type:1 LSID:45785 + [1693995941.309163][74050:74050] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693995941.309185][74050:74050] CHIP:IN: SecureSession[0x559c0bcaea80]: Allocated Type:1 LSID:45787 + [1693995941.309190][74050:74050] CHIP:SC: Assigned local session key ID 45787 + [1693995941.309194][74050:74050] CHIP:SC: Waiting for PBKDF param request + [1693995941.309202][74050:74050] CHIP:DIS: Updating services using commissioning mode 1 + [1693995941.309518][74050:74050] CHIP:DIS: CHIP minimal mDNS started advertising. + disabled: true + + - label: + "Step 97: CD Test Vector: The subjectKeyIdentifier contains invalid + SKID of a certificate unknown by Zigbee Alliance." + verification: | + For Raspberry Pi device, perform a factory reset using the following command - sudo rm -rf /tmp/chip_* for the 'chip-all-clusters-app. + please use the equivalent command on your respective platform to perform a factory reset + + + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_signer_info_skid_invalid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) indicates that the device is not genuine, or otherwise indicates a failure of device attestation, within its error handling APIs or user interface + + [1693993614.289269][72826:72826] CHIP:DMG: + [1693993614.289279][72826:72826] CHIP:EM: <<< [E:11915r S:25559 M:123399583 (Ack:174738663)] (S) Msg TX to 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) + [1693993614.289287][72826:72826] CHIP:IN: (S) Sending msg 123399583 on secure session with LSID: 25559 + [1693993614.289310][72826:72826] CHIP:DMG: Command handler moving to [CommandSen] + [1693993614.289313][72826:72826] CHIP:DMG: Command handler moving to [AwaitingDe] + [1693993614.289317][72826:72826] CHIP:DL: HandlePlatformSpecificBLEEvent 32783 + [1693993614.289321][72826:72826] CHIP:SVR: Failsafe timer expired + [1693993614.289324][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: MarkForEviction Type:1 LSID:25559 + [1693993614.289329][72826:72826] CHIP:SC: SecureSession[0x5585eb32ab80, LSID:25559]: State change 'kActive' --> 'kPendingEviction' + [1693993614.289344][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: Released - Type:1 LSID:25559 + [1693993614.289352][72826:72826] CHIP:SVR: Commissioning failed (attempt 1): src/app/server/CommissioningWindowManager.cpp:77: CHIP Error 0x00000032: Timeout + [1693993614.289370][72826:72826] CHIP:IN: SecureSession[0x5585eb32ab80]: Allocated Type:1 LSID:25561 + [1693993614.289375][72826:72826] CHIP:SC: Assigned local session key ID 25561 + [1693993614.289379][72826:72826] CHIP:SC: Waiting for PBKDF param request + [1693993614.289386][72826:72826] CHIP:DIS: Updating services using commissioning mode 1 + [1693993614.289637][72826:72826] CHIP:DIS: CHIP minimal mDNS started advertising. disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml index 7f190760dc2dfa..878806b49b0753 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml @@ -37,9 +37,9 @@ tests: disabled: true - label: - "Step 1a: For each of the following test cases, start the TH using the - appropriate certificate set, commission the TH using the DUT, then - factory reset the TH:" + "Step 1:Precondition: For each of the following test cases, start the + TH using the appropriate certificate set, commission the TH using the + DUT, then factory reset the TH:" verification: | Perform the following actions (PIs use equivalent command on their respective platform) - Start the TH using the required certificate set and PID. For chip-all-clusters-app, use the command given in the chip-all-clusters app command column @@ -49,7 +49,7 @@ tests: disabled: true - label: - "Step 1b: CD Test Vector: The product_id_array field has one PID value + "Step 1: CD Test Vector: The product_id_array field has one PID value which matches the PID value in DAC." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -78,7 +78,7 @@ tests: disabled: true - label: - "Step 1c: DAC Test Vector: Valid certificate signature algorithm + "Step 2: DAC Test Vector: Valid certificate signature algorithm ECDSA_WITH_SHA256" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -105,7 +105,7 @@ tests: disabled: true - label: - "Step 1d: PAI Test Vector: Certificate Key Usage extension + "Step 3: PAI Test Vector: Certificate Key Usage extension digitalSignature field is wrong (not present for DAC and present for PAI, which is OK as optional)" verification: | @@ -128,7 +128,7 @@ tests: [1690282103.319847][14495:14495] CHIP:DIS: Responding with _matter._tcp.local disabled: true - - label: "Step 1e: CD Test Vector: Valid CMS digest algorithm SHA256." + - label: "Step 4: CD Test Vector: Valid CMS digest algorithm SHA256." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_digest_algo_sha256/test_case_vector.json --product-id 32768 @@ -153,7 +153,7 @@ tests: disabled: true - label: - "Step 1f: DAC Test Vector: Fallback VID and PID encoding example from + "Step 5: DAC Test Vector: Fallback VID and PID encoding example from spec: valid and recommended since easily human-readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -177,7 +177,7 @@ tests: disabled: true - label: - "Step 1g: PAI Test Vector: Valid certificate public key curve + "Step 6: PAI Test Vector: Valid certificate public key curve prime256v1" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -207,7 +207,7 @@ tests: disabled: true - label: - "Step 1h: DAC Test Vector: Fallback VID and PID encoding example from + "Step 7: DAC Test Vector: Fallback VID and PID encoding example from spec: valid, but highly discouraged, since embedding of substrings within other substrings may be confusing to human readers" verification: | @@ -236,7 +236,7 @@ tests: disabled: true - label: - "Step 1i: PAI Test Vector: Valid certificate signature algorithm + "Step 8: PAI Test Vector: Valid certificate signature algorithm ECDSA_WITH_SHA256" verification: | @@ -264,7 +264,7 @@ tests: disabled: true - label: - "Step 1j: DAC Test Vector: Fallback VID and PID encoding example from + "Step 9: DAC Test Vector: Fallback VID and PID encoding example from spec: valid, but less readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -290,7 +290,7 @@ tests: disabled: true - label: - "Step 1k: CD Test Vector: Valid CMS signature algorithm + "Step 10: CD Test Vector: Valid CMS signature algorithm ECDSA_WITH_SHA256." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -326,7 +326,7 @@ tests: disabled: true - label: - "Step 1l: PAI Test Vector: Fallback VID and PID encoding example from + "Step 11: PAI Test Vector: Fallback VID and PID encoding example from spec: valid, but less readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -356,7 +356,7 @@ tests: disabled: true - label: - "Step 1m: DAC Test Vector: Certificate includes optional Extended Key + "Step 12: DAC Test Vector: Certificate includes optional Extended Key Usage extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -380,7 +380,7 @@ tests: disabled: true - label: - "Step 1n: DAC Test Vector: Mix of Fallback and Matter OID encoding for + "Step 14: DAC Test Vector: Mix of Fallback and Matter OID encoding for VID and PID: valid, Matter OIDs are used and wrong values in the common-name are ignored" verification: | @@ -404,7 +404,7 @@ tests: disabled: true - label: - "Step 1o: CD Test Vector: The product_id_array field has one PID value + "Step 15: CD Test Vector: The product_id_array field has one PID value which matches the PID value in DAC." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -439,7 +439,7 @@ tests: [1690280928.950815][13907:13907] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - - label: "Step 1p: CD Test Vector: Valid format_version field set to 1." + - label: "Step 16: CD Test Vector: Valid format_version field set to 1." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_format_version_1/test_case_vector.json --product-id 32768 @@ -464,7 +464,7 @@ tests: [1690283303.543293][15037:15037] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: "Step 1q: CD Test Vector: Valid CMS eContentType pkcs7-data." + - label: "Step 17: CD Test Vector: Valid CMS eContentType pkcs7-data." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_econtent_type_pkcs7_data/test_case_vector.json --product-id 32768 @@ -492,7 +492,7 @@ tests: disabled: true - label: - "Step 1r: DAC Test Vector: Fallback VID and PID encoding example from + "Step 19: DAC Test Vector: Fallback VID and PID encoding example from spec: valid example showing that order or separators are not considered at all for the overall validity of the embedded fields" verification: | @@ -517,10 +517,9 @@ tests: [1691133683.538318][11126:11126] CHIP:DIS: Responding with _matter._tcp.local disabled: true - - label: "Step 1s: struct_cd_authorized_paa_list_count1_valid (pid=32768)" - PICS: - "CD Test Vector: The authorized_paa_list contains one valid PAA which - is authorized to sign the PAI." + - label: + "Step 20: CD Test Vector: The authorized_paa_list contains one valid + PAA which is authorized to sign the PAI." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count1_valid/test_case_vector.json --product-id 32768 @@ -547,7 +546,7 @@ tests: disabled: true - label: - "Step 1t: DAC Test Vector: Certificate includes optional Authority + "Step 21: DAC Test Vector: Certificate includes optional Authority Information Access extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -574,7 +573,7 @@ tests: disabled: true - label: - "Step 1u: PAI Test Vector: Certificate includes optional Subject + "Step 22: PAI Test Vector: Certificate includes optional Subject Alternative Name extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -606,7 +605,7 @@ tests: disabled: true - label: - "Step 1v: PAI Test Vector: Valid certificate version field set to + "Step 23: PAI Test Vector: Valid certificate version field set to v3(2)" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -638,7 +637,7 @@ tests: disabled: true - label: - "Step 1x: DAC Test Vector: Valid certificate public key curve + "Step 24: DAC Test Vector: Valid certificate public key curve prime256v1" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -668,7 +667,7 @@ tests: disabled: true - label: - "Step 1y: CD Test Vector: Origin VID/PID different than VID/PID + "Step 25: CD Test Vector: Origin VID/PID different than VID/PID (correct use of origin)" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -704,7 +703,7 @@ tests: disabled: true - label: - "Step 1z: DAC Test Vector: Fallback VID and PID encoding example: + "Step 26: DAC Test Vector: Fallback VID and PID encoding example: valid, but less human-readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -735,38 +734,33 @@ tests: disabled: true - label: - "Step 1a1: CD Test Vector: The optional authorized_paa_list field is + "Step 27: CD Test Vector: The optional authorized_paa_list field is not present." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform - ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_11/test_case_vector.json --product-id 177 + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_missing/test_case_vector.json --product-id 32768 Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform - ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned - [1691133604.268090][11108:11108] CHIP:IN: (S) Sending msg 242960033 on secure session with LSID: 63451 - [1691133604.268262][11108:11108] CHIP:DMG: Command handler moving to [CommandSen] - [1691133604.268288][11108:11108] CHIP:DMG: Command handler moving to [AwaitingDe] - [1691133604.268325][11108:11108] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 - [1691133604.268347][11108:11108] CHIP:SVR: Commissioning completed successfully - [1691133604.268383][11108:11108] CHIP:DIS: Updating services using commissioning mode 0 - [1691133604.276764][11108:11108] CHIP:DIS: CHIP minimal mDNS started advertising. - [1691133604.304404][11108:11108] CHIP:DL: Using wifi MAC for hostname - [1691133604.304458][11108:11108] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 - [1691133604.304504][11108:11108] CHIP:DIS: Responding with _matter._tcp.local - [1691133604.304525][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local - [1691133604.304549][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local - [1691133604.304567][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local - [1691133604.304584][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local - [1691133604.304607][11108:11108] CHIP:DIS: Responding with _I3CBA812920C1A81B._sub._matter._tcp.local - [1691133604.304625][11108:11108] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 3CBA812920C1A81B-0000000000000001. - [1691133604.318978][11108:11108] CHIP:DIS: mDNS service published: _matter._tcp + [1696578156.356111][16897:16897] CHIP:DMG: Command handler moving to [CommandSen] + [1696578156.356116][16897:16897] CHIP:DMG: Command handler moving to [AwaitingDe] + [1696578156.356122][16897:16897] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1696578156.356125][16897:16897] CHIP:SVR: Commissioning completed successfully + [1696578156.356135][16897:16897] CHIP:DIS: Updating services using commissioning mode 0 + [1696578156.356317][16897:16897] CHIP:DIS: CHIP minimal mDNS started advertising. + [1696578156.356884][16897:16897] CHIP:DL: Using wifi MAC for hostname + [1696578156.356892][16897:16897] CHIP:DIS: Advertise operational node 35F3EA0B1085A647-0000000000000001 + [1696578156.356901][16897:16897] CHIP:DIS: Responding with _matter._tcp.local + [1696578156.356904][16897:16897] CHIP:DIS: Responding with 35F3EA0B1085A647-0000000000000001._matter._tcp.local + [1696578156.356907][16897:16897] CHIP:DIS: Responding with 35F3EA0B1085A647-0000000000000001._matter._tcp.local + [1696578156.356910][16897:16897] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a2: PAI Test Vector: Certificate Basic Constraint extension + "Step 28: PAI Test Vector: Certificate Basic Constraint extension PathLen field set to 0" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -794,7 +788,7 @@ tests: disabled: true - label: - "Step 1a3: PAI Test Vector: Certificate includes optional Extended Key + "Step 29: PAI Test Vector: Certificate includes optional Extended Key Usage extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -822,7 +816,7 @@ tests: disabled: true - label: - "Step 1a4: CD Test Vector: The authorized_paa_list contains two PAAs + "Step 30: CD Test Vector: The authorized_paa_list contains two PAAs one of which is valid PAA authorized to sign the PAI." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -857,7 +851,7 @@ tests: disabled: true - label: - "Step 1a5: PAI Test Vector: Fallback VID and PID encoding example: + "Step 31: PAI Test Vector: Fallback VID and PID encoding example: valid, but less human-readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -885,7 +879,7 @@ tests: disabled: true - label: - "Step 1a6: PAI Test Vector: Certificate includes optional Authority + "Step 32: PAI Test Vector: Certificate includes optional Authority Information Access extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -912,8 +906,8 @@ tests: disabled: true - label: - "Step 1a7: CD Test Vector: The product_id_array field has 10 PID - values one of which matches the PID value in DAC." + "Step 33: CD Test Vector: The product_id_array field has 10 PID values + one of which matches the PID value in DAC." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count10_valid/test_case_vector.json --product-id 32768 @@ -943,7 +937,7 @@ tests: disabled: true - label: - "Step 1a8: PAI Test Vector: Fallback VID and PID encoding example from + "Step 34: PAI Test Vector: Fallback VID and PID encoding example from spec: valid and recommended since easily human-readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -971,8 +965,8 @@ tests: disabled: true - label: - "Step 1a9: PAI Test Vector: Mix of Fallback and Matter OID encoding - for VID and PID: valid, Matter OIDs are used and wrong values in the + "Step 35: PAI Test Vector: Mix of Fallback and Matter OID encoding for + VID and PID: valid, Matter OIDs are used and wrong values in the common-name are ignored" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1000,7 +994,7 @@ tests: disabled: true - label: - "Step 1a10: CD Test Vector: The dac_origin_vendor_id and + "Step 36: CD Test Vector: The dac_origin_vendor_id and dac_origin_product_id fields are not present." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1028,9 +1022,9 @@ tests: disabled: true - label: - "Step 1a11: PAI Test Vector: Fallback VID and PID encoding example - from spec: valid, but highly discouraged, since embedding of - substrings within other substrings may be confusing to human readers" + "Step 37: PAI Test Vector: Fallback VID and PID encoding example from + spec: valid, but highly discouraged, since embedding of substrings + within other substrings may be confusing to human readers" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_05/test_case_vector.json --product-id 177 @@ -1060,8 +1054,8 @@ tests: disabled: true - label: - "Step 1a12: DAC Test Vector: Fallback VID and PID encoding example - from spec: valid and recommended since easily human-readable" + "Step 38: DAC Test Vector: Fallback VID and PID encoding example from + spec: valid and recommended since easily human-readable" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_01/test_case_vector.json --product-id 177 @@ -1086,7 +1080,7 @@ tests: disabled: true - label: - "Step 1a13: CD Test Vector: The product_id_array field has 100 PID + "Step 39: CD Test Vector: The product_id_array field has 100 PID values one of which matches the PID value in DAC." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1110,7 +1104,7 @@ tests: disabled: true - label: - "Step 1a14: CD Test Vector: The authorized_paa_list contains ten PAAs + "Step 40: CD Test Vector: The authorized_paa_list contains ten PAAs one of which is valid PAA authorized to sign the PAI." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1139,7 +1133,7 @@ tests: [1690284741.166783][15669:15669] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: "Step 1a15: CD Test Vector: Valid CMS version set to v3." + - label: "Step 41: CD Test Vector: Valid CMS version set to v3." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_v3/test_case_vector.json --product-id 32768 @@ -1168,10 +1162,9 @@ tests: disabled: true - label: - "Step 1a16: CD Test Vector: The version_number field matches the VID - and PID used in a DeviceSoftwareVersionModel entry in the DCL matching - the certification record associated with the product presenting this - CD." + "Step 42: CD Test Vector: The version_number field matches the VID and + PID used in a DeviceSoftwareVersionModel entry in the DCL matching the + certification record associated with the product presenting this CD." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_version_number_match/test_case_vector.json --product-id 32768 @@ -1197,8 +1190,8 @@ tests: disabled: true - label: - "Step 1a17: CD Test Vector: The subjectKeyIdentifier contains SKID of - a well-known Zigbee Alliance certificate." + "Step 43: CD Test Vector: The subjectKeyIdentifier contains SKID of a + well-known Zigbee Alliance certificate." verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_signer_info_skid_valid/test_case_vector.json --product-id 32768 @@ -1226,8 +1219,8 @@ tests: disabled: true - label: - "Step 1a18: PAI Test Vector: Fallback VID and PID encoding example - from spec: valid example showing that order or separators are not + "Step 44: PAI Test Vector: Fallback VID and PID encoding example from + spec: valid example showing that order or separators are not considered at all for the overall validity of the embedded fields" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1256,7 +1249,7 @@ tests: disabled: true - label: - "Step 1a19: DAC Test Vector: Certificate includes optional Subject + "Step 45: DAC Test Vector: Certificate includes optional Subject Alternative Name extension" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1285,7 +1278,7 @@ tests: disabled: true - label: - "Step 1a20: DAC Test Vector: Valid certificate version field set to + "Step 46: DAC Test Vector: Valid certificate version field set to v3(2)" verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform @@ -1321,8 +1314,8 @@ tests: disabled: true - label: - "Step 1a21: PAI Test Vector: Fallback VID and PID encoding example - from spec: valid and recommended since easily human-readable " + "Step 47: PAI Test Vector: Fallback VID and PID encoding example from + spec: valid and recommended since easily human-readable " verification: | Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_02/test_case_vector.json --product-id 177 diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 5fb15e49a1530e..8778cc209883b5 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -106,27 +106,6 @@ tests: [1692617790.900428][31584:31586] CHIP:TOO: Revision: 1 [1692617790.900430][31584:31586] CHIP:TOO: } - ./chip-tool descriptor read device-type-list 1 1 - - On TH (Chip-tool) log, Verify that - - If PartsLists count is 0 then, DeviceTypeList count is at least one. - - DeviceTypeList should contains exactly one Application Device Type [In below log 256(In hex 0x100) is a Application Device Type(On/OffLight)] or set of Application Device Types which are a subset of each other. - - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type.[In below log DeviceType: 17(In hex 0x0011) is a Utility DeviceType ] - - Revision value is not less than 1 and it should match the Revision of the DeviceType and below is the sample log provided for the raspi platform - - [1674552599.264189][21135:21137] CHIP:DMG: } - [1692617790.900384][31584:31586] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2832593371 - [1692617790.900398][31584:31586] CHIP:TOO: DeviceTypeList: 2 entries - [1692617790.900410][31584:31586] CHIP:TOO: [1]: { - [1692617790.900413][31584:31586] CHIP:TOO: DeviceType: 256 - [1692617790.900416][31584:31586] CHIP:TOO: Revision: 1 - [1692617790.900419][31584:31586] CHIP:TOO: } - [1692617790.900423][31584:31586] CHIP:TOO: [2]: { - [1692617790.900425][31584:31586] CHIP:TOO: DeviceType: 17 - [1692617790.900428][31584:31586] CHIP:TOO: Revision: 1 - [1692617790.900430][31584:31586] CHIP:TOO: } - - ./chip-tool descriptor read parts-list 1 2 Verify parts-list response contains 0 entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform: @@ -235,6 +214,20 @@ tests: [1693218196.393772][13451:13453] CHIP:TOO: [68]: 1294 [1693218196.393783][13451:13453] CHIP:TOO: [69]: 2820 [1693218196.393794][13451:13453] CHIP:TOO: [70]: 4294048773 + + ./chip-tool descriptor read server-list 1 2 + + Verify ServerList entries on TH (Chip-tool) Log and below is the sample log provided for the raspi platform, Here ServerList entries are 7. + + [1692618559.962829][31688:31690] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1103199808 + [1692618559.962884][31688:31690] CHIP:TOO: ServerList: 7 entries + [1692618559.962910][31688:31690] CHIP:TOO: [1]: 3 + [1692618559.962922][31688:31690] CHIP:TOO: [2]: 4 + [1692618559.962933][31688:31690] CHIP:TOO: [3]: 5 + [1692618559.962945][31688:31690] CHIP:TOO: [4]: 6 + [1692618559.962955][31688:31690] CHIP:TOO: [5]: 29 + [1692618559.962966][31688:31690] CHIP:TOO: [6]: 47 + [1692618559.962978][31688:31690] CHIP:TOO: [7]: 1030 disabled: true - label: "Step 3: TH reads 'ClientList' attribute" diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_3_1.yaml new file mode 100644 index 00000000000000..bbfdb221792a68 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_3_1.yaml @@ -0,0 +1,39 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 88.2.4. [TC-DGGEN-3.1] Matter Specification 1.2 errata [DUT as Server] + +PICS: + - DGGEN.S + +config: + nodeId: 0x12344321 + cluster: "General Diagnostics" + endpoint: 0 + +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads AttributeList attribute" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + excludes: [0x09] diff --git a/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml index 6f1fc9d599369a..8ac9fd1a0afd2e 100644 --- a/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml @@ -122,35 +122,7 @@ tests: type: list contains: [11] - - label: "Step 5a: TH reads AcceptedCommandList from DUT" - PICS: " !DGWIFI.S.F01 " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 5b: TH reads Feature dependent(DGWIFI.S.F01) command in - AcceptedCommandList from DUT" - PICS: DGWIFI.S.F01 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 6: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7a: TH reads EventList from DUT" + - label: "Step 5a: TH reads EventList from DUT" PICS: " !DGWIFI.S.E00 && !DGWIFI.S.E01 && !DGWIFI.S.E02 && PICS_EVENT_LIST_ENABLED" @@ -160,8 +132,9 @@ tests: value: [] constraints: type: list + - label: - "Step 7b: TH reads optional attribute (Disconnection) in EventList + "Step 5b: TH reads optional attribute (Disconnection) in EventList from DUT" PICS: DGWIFI.S.E00 && PICS_EVENT_LIST_ENABLED command: "readAttribute" @@ -170,8 +143,9 @@ tests: constraints: type: list contains: [0] + - label: - "Step 7c: TH reads optional attribute (AssociationFailure) in + "Step 5c: TH reads optional attribute (AssociationFailure) in EventList from DUT" PICS: DGWIFI.S.E01 && PICS_EVENT_LIST_ENABLED command: "readAttribute" @@ -180,8 +154,9 @@ tests: constraints: type: list contains: [1] + - label: - "Step 7d: TH reads optional attribute (ConnectionStatus) in EventList + "Step 5d: TH reads optional attribute (ConnectionStatus) in EventList from DUT" PICS: DGWIFI.S.E02 && PICS_EVENT_LIST_ENABLED command: "readAttribute" @@ -190,3 +165,31 @@ tests: constraints: type: list contains: [2] + + - label: "Step 6a: TH reads AcceptedCommandList from DUT" + PICS: " !DGWIFI.S.F01 " + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: + "Step 6b: TH reads Feature dependent(DGWIFI.S.F01) command in + AcceptedCommandList from DUT" + PICS: DGWIFI.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + + - label: "Step 7: TH reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml index 7e27605410e1cb..9adead9001cbce 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml @@ -17,7 +17,7 @@ name: 198.2.2. [TC-DISHALM-3.1] Inflow alarm functionality with DUT as Server PICS: - DISHALM.S - - PIXIT.DISHALM.InflowAlarmSupported + - DISHALM.S.M.InflowAlarmSupported config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml index 98ef5006cacf94..d8c82d40b7e00c 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml @@ -17,7 +17,7 @@ name: 198.2.3. [TC-DISHALM-3.2] Drain alarm functionality with DUT as Server PICS: - DISHALM.S - - PIXIT.DISHALM.DrainAlarmSupported + - DISHALM.S.M.DrainAlarmSupported config: nodeId: "0x12344321" @@ -166,7 +166,7 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - dishwasheralarm reset 1 1 1 + dishwasheralarm reset 2 1 1 Verify the success Response on TH(chip-tool) [1690974433.649056][3934:3936] CHIP:DMG: ], [1690974433.649084][3934:3936] CHIP:DMG: diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml index dd1c8e75789e5e..c7735d4bf354a0 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml @@ -17,7 +17,7 @@ name: 198.2.4. [TC-DISHALM-3.3] Door alarm functionality with DUT as Server PICS: - DISHALM.S - - PIXIT.DISHALM.DoorAlarmSupported + - DISHALM.S.M.DoorAlarmSupported config: nodeId: 0x12344321 @@ -167,7 +167,7 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - dishwasheralarm reset 1 1 1 + dishwasheralarm reset 4 1 1 Verify the success response on TH(chip-tool) [1690974433.649056][3934:3936] CHIP:DMG: ], [1690974433.649084][3934:3936] CHIP:DMG: diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml index 2b1c94bd58f59b..90be26d415f46f 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml @@ -19,7 +19,7 @@ name: PICS: - DISHALM.S - - PIXIT.DISHALM.TempLowAlarmSupported + - DISHALM.S.M.TempLowAlarmSupported config: nodeId: 0x12344321 @@ -169,7 +169,7 @@ tests: set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - dishwasheralarm reset 1 1 1 + dishwasheralarm reset 8 1 1 Verify the success Response on TH(chip-tool) [1690974433.649056][3934:3936] CHIP:DMG: ], [1690974433.649084][3934:3936] CHIP:DMG: diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml index a2b66804fc367f..1d9b510d02a62d 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml @@ -19,7 +19,7 @@ name: PICS: - DISHALM.S - - PIXIT.DISHALM.TempHighAlarmSupported + - DISHALM.S.M.TempHighAlarmSupported config: nodeId: 0x12344321 @@ -169,7 +169,7 @@ tests: Alarms set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - dishwasheralarm reset 1 1 1 + dishwasheralarm reset 16 1 1 Verify the success response on TH(chip-tool) [1690974433.649056][3934:3936] CHIP:DMG: ], [1690974433.649084][3934:3936] CHIP:DMG: diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml index e6c8cd85c8179d..c67507fed78261 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml @@ -18,7 +18,7 @@ name: PICS: - DISHALM.S - - PIXIT.DISHALM.WaterLevelAlarmSupported + - DISHALM.S.M.WaterLevelAlarmSupported config: nodeId: 0x12344321 @@ -168,7 +168,7 @@ tests: Alarms set to 1" PICS: DISHALM.S.F00 && DISHALM.S.C00.Rsp verification: | - dishwasheralarm reset 1 1 1 + dishwasheralarm reset 32 1 1 Verify the success response on TH(chip-tool) [1690974433.649056][3934:3936] CHIP:DMG: ], [1690974433.649084][3934:3936] CHIP:DMG: diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml index cd6c4dbac170a2..c45ce0700c179b 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml @@ -35,10 +35,10 @@ tests: verification: | ./chip-tool dishwashermode read cluster-revision 1 1 - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: + Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number (2) on the TH(Chip-tool) and below is the sample log provided for the raspi platform: [1690365584.246794][27436:27438] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFD DataVersion: 1130015440 - [1690365584.246860][27436:27438] CHIP:TOO: ClusterRevision: 1 + [1690365584.246860][27436:27438] CHIP:TOO: ClusterRevision: 2 disabled: true - label: "Step 3: TH reads from the DUT the FeatureMap attribute." diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index e54dbd3b2af7f0..b049f65f8a7d64 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -248,7 +248,7 @@ tests: minValue: 0 maxValue: 11 - - label: "Step 2c: TH writes LockType attribute as 10" + - label: "Step 2b: TH writes LockType attribute as 10" PICS: DRLK.S.A0001 command: "writeAttribute" attribute: "LockType" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml index c7b566e61e9b7e..f561d9130e46ce 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml @@ -450,7 +450,7 @@ tests: 0-Single" PICS: DRLK.S.F08 && DRLK.S.C1a.Rsp verification: | - ./chip-tool doorlock set-user 0 2 xxx 6452 3 0 0 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock set-user 0 2 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 Via the TH (chip-tool), verify the SUCCESS response for setting the users details. @@ -459,15 +459,6 @@ tests: [1658994912.123915][4290:4295] CHIP:DMG: status = 0x00 (SUCCESS), [1658994912.123959][4290:4295] CHIP:DMG: }, [1658994912.124003][4290:4295] CHIP:DMG: - [1658994912.124039][4290:4295] CHIP:DMG: }, - [1658994912.124079][4290:4295] CHIP:DMG: - [1658994912.124110][4290:4295] CHIP:DMG: }, - [1658994912.124147][4290:4295] CHIP:DMG: - [1658994912.124176][4290:4295] CHIP:DMG: ], - [1658994912.124212][4290:4295] CHIP:DMG: - [1658994912.124241][4290:4295] CHIP:DMG: InteractionModelRevision = 1 - [1658994912.124270][4290:4295] CHIP:DMG: }, - [1658994912.124341][4290:4295] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001A Status=0x0 disabled: true - label: "Step 5b: TH reads the LockUserChange event from DUT" @@ -631,7 +622,7 @@ tests: [1658995364.178185][4383:4388] CHIP:DMG: }, - ./chip-tool doorlock set-user 0 1 xxx 6452 3 0 0 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock set-user 0 1 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 Via the TH (chip-tool), verify the SUCCESS response for setting the users details. diff --git a/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml index 8f9488832969b1..bcda3fadbe0248 100644 --- a/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml @@ -116,7 +116,7 @@ tests: type: bitmap32 hasMasksSet: [0x20] - - label: "Step 4: Read the global attribute: AttributeList" + - label: "Step 4a: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED command: "readAttribute" attribute: "AttributeList" @@ -125,7 +125,7 @@ tests: type: list contains: [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Step 4: Read the global attribute: AttributeList" + - label: "Step 4a: Read the global attribute: AttributeList" PICS: "!PICS_EVENT_LIST_ENABLED" command: "readAttribute" attribute: "AttributeList" @@ -135,7 +135,7 @@ tests: contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - label: - "Step 4: Read the feature dependent FAN.S.F00 (SPD) attribute in + "Step 4c: Read the feature dependent FAN.S.F00 (SPD) attribute in AttributeList" PICS: FAN.S.F00 command: "readAttribute" @@ -146,7 +146,7 @@ tests: contains: [4, 5, 6] - label: - "Step 4: Read the feature dependent FAN.S.F02(RCK) attribute in + "Step 4d: Read the feature dependent FAN.S.F02(RCK) attribute in AttributeList" PICS: FAN.S.F02 command: "readAttribute" @@ -157,7 +157,7 @@ tests: contains: [7, 8] - label: - "Step 4: Read the feature dependent FAN.S.F03(WND) attribute in + "Step 4e: Read the feature dependent FAN.S.F03(WND) attribute in AttributeList" PICS: FAN.S.F03 command: "readAttribute" @@ -168,7 +168,7 @@ tests: contains: [9, 10] - label: - "Step 4: Read the feature dependent FAN.S.F05(DIR) attribute in + "Step 4f: Read the feature dependent FAN.S.F05(DIR) attribute in AttributeList" PICS: FAN.S.F05 command: "readAttribute" @@ -178,6 +178,15 @@ tests: type: list contains: [11] + - label: "Step 5: TH reads EventList attribute from DUT" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + - label: "Step 6: Read the global attribute: AcceptedCommandList" PICS: " !FAN.S.C00.Rsp " command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml index 5e8af70f3a8fc0..0f649db450f85a 100755 --- a/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml index e551005ca6ff93..4094c677705b6b 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml @@ -44,20 +44,20 @@ tests: When the ICDM feature is not supported or enabled, the SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT is set to 60 minutes. disabled: true - - label: "Step 0b: CR1 reads from the DUT the IdleModeInterval attribute." + - label: "Step 0b: CR1 reads from the DUT the IdleModeDuration attribute." PICS: ICDM.S verification: | - CR1 reads from the DUT the IdleModeInterval attribute by sending below mentioned command + CR1 reads from the DUT the IdleModeDuration attribute by sending below mentioned command icdmanagement read idle-mode-interval 1 0 - Please note down the value of IdleModeInterval as SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT for use in the next step validations. + Please note down the value of IdleModeDuration as SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT for use in the next step validations. [1692870543.225457][7160:7162] CHIP:DMG: SuppressResponse = true, [1692870543.225495][7160:7162] CHIP:DMG: InteractionModelRevision = 10 [1692870543.225528][7160:7162] CHIP:DMG: } [1692870543.225723][7160:7162] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0000 DataVersion: 4022467249 - [1692870543.225795][7160:7162] CHIP:TOO: IdleModeInterval: 2000 + [1692870543.225795][7160:7162] CHIP:TOO: IdleModeDuration: 2000 [1692870543.225992][7160:7162] CHIP:EM: <<< [E:52837i S:57653 M:52559591 (Ack:263018291)] (S) Msg TX to 1:0000000000000001 [853D] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true @@ -493,8 +493,18 @@ tests: clusters on all endpoints on a Node for which it does not have access. AttributePath = [[ ]]." verification: | - Chip-Tool support required to validate this step : SDK Issue - https://github.com/project-chip/connectedhomeip/issues/28360 - Not Testable + sending a command along with unregistered commissioner node id (5) + + any subscribe-by-id 0xFFFFFFFF 0xFFFFFFFF 10 100 1 0XFFFF --commissioner-nodeid 5 + On CR2, Verify that the DUT returns a "INVALID_ACTION" status response. + + [1695815340.162063][2522:2524] CHIP:EM: Rxd Ack; Removing MessageCounter:187875065 from Retrans Table on exchange 10455i + [1695815340.162181][2522:2524] CHIP:DMG: StatusResponseMessage = + [1695815340.162244][2522:2524] CHIP:DMG: { + [1695815340.162298][2522:2524] CHIP:DMG: Status = 0x80 (INVALID_ACTION), + [1695815340.162357][2522:2524] CHIP:DMG: InteractionModelRevision = 11 + [1695815340.162412][2522:2524] CHIP:DMG: } + [1695815340.162501][2522:2524] CHIP:IM: Received status response, status is 0x80 (INVALID_ACTION) disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml index f8c43fa159f8fb..40fd141fdc9a6b 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml @@ -838,14 +838,24 @@ tests: disabled: true - label: - "Step 12: TH sends Subscribe Request Message to DUT with EventRequests - set to path which indicates a cluster event that is not supported." + "Step 12: TH sends Subscribe Request Message to DUT. DUT sends Report + Data message to DUT + TH sends Status Response Message with an error + Status." verification: | Mark this as not testable /NA. Out of Scope + SDK Issue : https://github.com/project-chip/connectedhomeip/issues/23990 disabled: true - label: "Step 13: TH sends Subscribe Request Message to DUT with EventRequests + set to path which indicates a cluster event that is not supported." + verification: | + Mark this as not testable /NA. Out of Scope + SDK Issue : https://github.com/project-chip/connectedhomeip/issues/23990 + disabled: true + + - label: + "Step 14: TH sends Subscribe Request Message to DUT with EventRequests set to path which requires a privilege that is not granted for the cluster in the path." verification: | @@ -899,7 +909,7 @@ tests: disabled: true - label: - "Step 14: TH sends Subscribe Request Message to DUT with EventRequests + "Step 16: TH sends Subscribe Request Message to DUT with EventRequests set to Wildcard path where reading an event in the path requires a privilege that is not granted for the cluster in the path." verification: | diff --git a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml index 91ab6841eb12e8..8932fe0e7506ea 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml index bb24a3fb9600c2..c49d1158d8e60a 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml @@ -31,23 +31,13 @@ tests: - name: "nodeId" value: nodeId - #Issue: https://github.com/project-chip/connectedhomeip/issues/26445 - - label: "Step 2: TH reads the ClusterRevision attribute from the DUT" - verification: | - ./chip-tool modeselect read cluster-revision 1 1 - - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 2 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - [1645775623.658997][3277:3282] CHIP:TOO: ClusterRevision: 1 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Step 2: Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 2 + constraints: + type: int16u - label: "Step 3: TH reads the FeatureMap attribute from the DUT" PICS: MOD.S.F00 diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml index cf01ff44d05efe..17471bfc43d7e6 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml @@ -304,12 +304,15 @@ tests: - label: "Step 16: Manually put the DUT into a state wherein it cannot receive a Start Command" + PICS: OPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME verification: | Manually put the DUT into a state wherein it cannot receive a Start Command disabled: true - label: "Step 17: TH sends Start command to the DUT" - PICS: OPSTATE.S.C02.Rsp && OPSTATE.S.C04.Tx + PICS: + OPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME && OPSTATE.S.C02.Rsp && + OPSTATE.S.C04.Tx verification: | ./chip-tool operationalstate start 1 1 diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml index a80ea7c76f93f9..2415830c81adc0 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml index 8dd2428b9dd203..ad7ff4866e2c32 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml b/src/app/tests/suites/certification/Test_TC_S_1_1.yaml index 0fdc16b325b0d7..ed3fe73f726710 100644 --- a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_1_1.yaml @@ -48,10 +48,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x1] - # This needs to be changed in the Name Support PR: https://github.com/project-chip/connectedhomeip/pull/29639 - # Issue in Test plan repo: https://github.com/CHIP-Specifications/chip-test-plans/issues/3515 - #hasMasksClear: [0x1] + hasMasksClear: [0x1] - label: "Step 3a: Read FeatureMap (global attribute 65532)" PICS: S.S.F00 @@ -62,6 +59,22 @@ tests: type: bitmap32 hasMasksSet: [0x1] + - label: "Step 3b: Read FeatureMap (global attribute 65532)" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Step 3c: Read FeatureMap (global attribute 65532)" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + - label: "Step 4: Read Mandatory attributes in AttributeList (global attribute 65531)" diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index f084d75cdc5370..16780a7e9c0353 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -47,6 +47,36 @@ tests: - name: "SceneTableSize" saveAs: maxScenes + - label: "Arithmetic operation to get the maxScenes - 1" + cluster: "Unit Testing" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: maxScenes - 1 + - name: "arg2" + value: 0 + response: + values: + - name: "returnValue" + saveAs: maxScenesMinusOne + value: maxScenes - 1 + + - label: "Arithmetic operation to get the fabric Capacity" + cluster: "Unit Testing" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: maxScenesMinusOne / 2 + - name: "arg2" + value: 0 + response: + values: + - name: "returnValue" + saveAs: fabricCapacity + value: maxScenesMinusOne / 2 + - label: "Step 0a: preparation step for using commands from Groups cluster: Add KeySet" @@ -137,7 +167,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) + value: fabricCapacity - name: "GroupID" value: G1 @@ -526,7 +556,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 1 + value: fabricCapacity - 1 - name: "GroupID" value: G1 - name: "SceneList" @@ -563,7 +593,7 @@ tests: value: 0x00 - name: "Capacity" constraints: - anyOf: [( maxScenes / 2 ), 0xfe, 0x89] + anyOf: [fabricCapacity, 0xfe, 0x89] - name: "GroupID" value: G1 @@ -683,7 +713,7 @@ tests: value: 0x00 - name: "Capacity" constraints: - anyOf: [( maxScenes / 2 ) - 1, 0xfe, 0x89] + anyOf: [fabricCapacity - 1, 0xfe, 0x89] - name: "GroupID" value: G1 - name: "SceneList" @@ -724,7 +754,7 @@ tests: value: 0x00 - name: "Capacity" constraints: - anyOf: [( maxScenes / 2 ), 0xfe, 0x89] + anyOf: [fabricCapacity, 0xfe, 0x89] - name: "GroupID" value: G1 @@ -917,7 +947,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 2 + value: fabricCapacity - 2 - name: "GroupID" value: G1 - name: "SceneList" @@ -975,7 +1005,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 2 + value: fabricCapacity - 2 - name: "GroupID" value: G2 @@ -1070,7 +1100,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 3 + value: fabricCapacity - 3 - name: "GroupID" value: G2 - name: "SceneList" diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index 5e0b5d21fa41ad..a125b004025505 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -44,6 +44,36 @@ tests: - name: "SceneTableSize" saveAs: maxScenes + - label: "Arithmetic operation to get the maxScenes - 1" + cluster: "Unit Testing" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: maxScenes - 1 + - name: "arg2" + value: 0 + response: + values: + - name: "returnValue" + saveAs: maxScenesMinusOne + value: maxScenes - 1 + + - label: "Arithmetic operation to get the fabric Capacity" + cluster: "Unit Testing" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: maxScenesMinusOne / 2 + - name: "arg2" + value: 0 + response: + values: + - name: "returnValue" + saveAs: fabricCapacity + value: maxScenesMinusOne / 2 + - label: "Step 0a: preparation step for using commands from Groups cluster: Add KeySet" @@ -149,7 +179,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: maxScenes / 2 + value: fabricCapacity - name: "GroupID" value: G1 - name: "SceneList" @@ -505,7 +535,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 1 + value: fabricCapacity - 1 - name: "GroupID" value: G1 - name: "SceneList" @@ -559,14 +589,14 @@ tests: - name: "SceneID" value: 0x01 - - label: "Wait 1s" + - label: "Wait 1+ s" PICS: PICS_SDK_CI_ONLY cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 1050 + value: 1250 - label: "TH confirm the DUT reached AC1 (on level control cluster) after 1s" @@ -632,7 +662,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: ( maxScenes / 2 ) - 2 + value: fabricCapacity - 2 - name: "GroupID" value: G1 - name: "SceneList" diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml index e0f6df2d917fb4..a9e64fb9ae44e7 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml index 79b3ca1c190665..545dcae0f5a5d0 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml @@ -120,6 +120,8 @@ tests: TemperatureSetpoint attribute." PICS: TCTL.S.A0000 verification: | + After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, @@ -175,6 +177,8 @@ tests: TemperatureSetpoint attribute." PICS: TCTL.S.A0000 verification: | + After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, @@ -240,6 +244,8 @@ tests: TemperatureSetpoint attribute." PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0000 verification: | + After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml index 5ecfe9666a2471..965a96aa6d4dae 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml @@ -87,6 +87,8 @@ tests: SelectedTemperatureLevel attribute" PICS: TCTL.S.A0004 verification: | + After a few seconds, please send the below mentioned command to read SelectedTemperatureLevel attribute from TH to DUT + ./chip-tool temperaturecontrol read selected-temperature-level 1 1 On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 [1692265713.881978][13985:13987] CHIP:DMG: } @@ -128,6 +130,8 @@ tests: SelectedTemperatureLevel attribute" PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0004 verification: | + After a few seconds, please send the below mentioned command to read SelectedTemperatureLevel attribute from TH to DUT + ./chip-tool temperaturecontrol read selected-temperature-level 1 1 On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 [1692265822.762570][14005:14007] CHIP:DMG: SuppressResponse = true, diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_5_1_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_5_1_Simulated.yaml index c60e92dd413e57..6535b40291af1f 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_5_1_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_5_1_Simulated.yaml @@ -28,29 +28,28 @@ tests: # command: "WaitForCommissioning" ##Check Attribute defining the cluster Features - - label: "DUT reads the FeatureMap attribute from TH" - PICS: WNCV.C.Afffc + - label: "Step 1a: DUT reads the FeatureMap attribute from TH" wait: "readAttribute" attribute: "FeatureMap" ##Check Attributes defining the product - - label: "DUT reads the Type attribute from TH" + - label: "Step 2a: DUT reads the Type attribute from TH" PICS: WNCV.C.A0000 wait: "readAttribute" attribute: "Type" - - label: "DUT reads the EndProductType attribute from TH" + - label: "Step 2b: DUT reads the EndProductType attribute from TH" PICS: WNCV.C.A000d wait: "readAttribute" attribute: "EndProductType" ##Check Attributes defining the working status - - label: "DUT reads the Mode attribute from TH" + - label: "Step 3a: DUT reads the Mode attribute from TH" PICS: WNCV.C.A0017 wait: "readAttribute" attribute: "Mode" - - label: "DUT reads the ConfigStatus attribute from TH" + - label: "Step 3b: DUT reads the ConfigStatus attribute from TH" PICS: WNCV.C.A0007 wait: "readAttribute" attribute: "ConfigStatus" diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_6_1_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_6_1_Simulated.yaml index c008fa5ade2f07..5ee0c33a9f97c1 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_6_1_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_6_1_Simulated.yaml @@ -27,14 +27,14 @@ tests: # cluster: "DelayCommands" # command: "WaitForCommissioning" - - label: "DUT sends UpOrOpen command to TH" + - label: "Step 1a: DUT sends UpOrOpen command to TH" wait: "UpOrOpen" PICS: WNCV.C.C00.Tx - - label: "DUT sends DownOrClose command to TH" + - label: "Step 2a: DUT sends DownOrClose command to TH" wait: "DownOrClose" PICS: WNCV.C.C01.Tx - - label: "DUT sends StopMotion command to TH" + - label: "Step 3a: DUT sends StopMotion command to TH" wait: "StopMotion" PICS: WNCV.C.C02.Tx diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_7_1_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_7_1_Simulated.yaml index 2c2bf77473dc90..6f2b6140cabacf 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_7_1_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_7_1_Simulated.yaml @@ -30,11 +30,13 @@ tests: # command: "WaitForCommissioning" - label: - "If (PA_LF & LF) DUT sends GoToLiftPercentage command with 50% to DUT" + "Step 1a: If (PA_LF & LF) DUT sends GoToLiftPercentage command with + 50% to DUT" wait: "GoToLiftPercentage" PICS: WNCV.C.C05.Tx - label: - "If (PA_TL & TL) DUT sends GoToTiltPercentage command with 50% to DUT" + "Step 2a: If (PA_TL & TL) DUT sends GoToTiltPercentage command with + 50% to DUT" wait: "GoToTiltPercentage" PICS: WNCV.C.C08.Tx diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 4869039cf87fef..a4dcce73f08600 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -111,11 +111,6 @@ WNCV.C.A0011=0 WNCV.C.A0012=0 WNCV.C.A0013=0 WNCV.C.A001a=0 -WNCV.C.Afff8=0 -WNCV.C.Afff9=0 -WNCV.C.Afffa=0 -WNCV.C.Afffb=0 -WNCV.C.Afffd=0 WNCV.C.C04.Tx=0 WNCV.C.C07.Tx=0 WNCV.S.A0011.Scene=0 @@ -123,7 +118,6 @@ WNCV.S.A0012.Scene=0 WNCV.S.C04.Rsp=0 WNCV.S.C07.Rsp=0 -WNCV.C.Afffc=1 WNCV.C.A0000=1 WNCV.C.A000d=1 WNCV.C.A0017=1 @@ -453,7 +447,7 @@ AUDIOOUTPUT.S.C01.Rsp=1 AUDIOOUTPUT.C=1 AUDIOOUTPUT.C.C00.Tx=1 AUDIOOUTPUT.C.C01.Tx=1 -AUDIOOUTPUT.S.F00=0 +AUDIOOUTPUT.S.F00=1 TGTNAV.S=1 TGTNAV.S.A0000=1 @@ -679,7 +673,7 @@ S.S.AM=0 S.S.AO=0 S.S.F00=1 S.S.F01=1 -S.S.F02=0 +S.S.F02=1 S.S.F03=0 PICS_SC_RECALL_SCENE_TRANSITION_TIME=1 @@ -2384,7 +2378,7 @@ RVCCLEANM.S=1 #Server RVCCLEANM.S.A0000=1 RVCCLEANM.S.A0001=1 -RVCCLEANM.S.A0002=1 +RVCCLEANM.S.A0002=0 RVCCLEANM.S.A0003=1 #Feature @@ -2457,7 +2451,7 @@ RVCRUNM.S.F00=1 #Server RVCRUNM.S.A0000=1 RVCRUNM.S.A0001=1 -RVCRUNM.S.A0002=1 +RVCRUNM.S.A0002=0 RVCRUNM.S.A0003=1 #Commands @@ -2628,7 +2622,7 @@ RVCRUNM.S=1 RVCRUNM.S.F00=1 RVCRUNM.S.A0000=1 RVCRUNM.S.A0001=1 -RVCRUNM.S.A0002=1 +RVCRUNM.S.A0002=0 RVCRUNM.S.A0003=1 RVCRUNM.S.C00.Rsp=1 RVCRUNM.S.C01.Tx=1 diff --git a/src/app/util/BUILD.gn b/src/app/util/BUILD.gn index 7c7ec66b7e709c..31d6b9e881956a 100644 --- a/src/app/util/BUILD.gn +++ b/src/app/util/BUILD.gn @@ -13,3 +13,4 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("${chip_root}/src/app/common_flags.gni") diff --git a/src/app/util/mock/include/zap-generated/gen_config.h b/src/app/util/mock/include/zap-generated/gen_config.h index 08d2d851b6b93d..60d57388626fa6 100644 --- a/src/app/util/mock/include/zap-generated/gen_config.h +++ b/src/app/util/mock/include/zap-generated/gen_config.h @@ -18,3 +18,4 @@ #pragma once #define EMBER_BINDING_TABLE_SIZE 20 +#define MATTER_SCENES_TABLE_SIZE 24 diff --git a/src/app/zap-templates/partials/idl/cluster_definition.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt index 54f6f687c9538a..ea8923f66c578b 100644 --- a/src/app/zap-templates/partials/idl/cluster_definition.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -8,7 +8,7 @@ cluster {{asUpperCamelCase name}} = {{!}} {{~code~}} {{/if}} { {{#zcl_enums}} - enum {{asUpperCamelCase name preserveAcronyms=true}} : ENUM{{multiply size 8}} { + enum {{asUpperCamelCase name preserveAcronyms=true}} : enum{{multiply size 8}} { {{#zcl_enum_items}} k{{asUpperCamelCase label preserveAcronyms=true}} = {{value}}; {{/zcl_enum_items}} @@ -16,7 +16,7 @@ cluster {{asUpperCamelCase name}} = {{!}} {{/zcl_enums}} {{#zcl_bitmaps}} - bitmap {{asUpperCamelCase name preserveAcronyms=true}} : BITMAP{{multiply size 8}} { + bitmap {{asUpperCamelCase name preserveAcronyms=true}} : bitmap{{multiply size 8}} { {{#zcl_bitmap_items}} k{{asUpperCamelCase label preserveAcronyms=true}} = {{asHex mask}}; {{/zcl_bitmap_items}} diff --git a/src/app/zap-templates/templates/app/gen_config.zapt b/src/app/zap-templates/templates/app/gen_config.zapt index 01048170425067..4accc4a61be151 100644 --- a/src/app/zap-templates/templates/app/gen_config.zapt +++ b/src/app/zap-templates/templates/app/gen_config.zapt @@ -5,57 +5,58 @@ /**** Cluster endpoint counts ****/ {{#all_user_clusters}} -#define EMBER_AF_{{asDelimitedMacro define}}_{{asDelimitedMacro side}}_ENDPOINT_COUNT ({{user_endpoint_count_by_cluster id side}}) +#define EMBER_AF_{{as_delimited_macro define}}_{{as_delimited_macro side}}_ENDPOINT_COUNT ({{user_endpoint_count_by_cluster id side}}) {{/all_user_clusters}} /**** Cluster Plugins ****/ {{#all_user_clusters}} // Use this macro to check if the {{side}} side of the {{name}} cluster is included -#define ZCL_USING_{{asDelimitedMacro define}}_{{asDelimitedMacro side}} -#define EMBER_AF_PLUGIN_{{asDelimitedMacro name}}_{{asDelimitedMacro side}} -{{#if (isServer side)}} -#define EMBER_AF_PLUGIN_{{asDelimitedMacro name}} +#define ZCL_USING_{{as_delimited_macro define}}_{{as_delimited_macro side}} +#define EMBER_AF_PLUGIN_{{as_delimited_macro name}}_{{as_delimited_macro side}} +{{#if (is_server side)}} +#define EMBER_AF_PLUGIN_{{as_delimited_macro name}} {{/if}} -{{#if (isStrEqual name "Color Control")}} -{{#if (isServer side)}} +{{#if (is_str_equal name "Color Control")}} +{{#if (is_server side)}} // User options for {{side}} plugin {{name}} #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV {{/if}} -{{else if (isStrEqual name "IAS Zone")}} +{{else if (is_str_equal name "IAS Zone")}} // User options for {{side}} plugin {{name}} -{{#if (isServer side)}} +{{#if (is_server side)}} #define EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE 541 {{else}} #define EMBER_AF_PLUGIN_IAS_ZONE_CLIENT_MAX_DEVICES 10 {{/if}} -{{else if (isStrEqual name "Level Control")}} -{{#if (isServer side)}} +{{else if (is_str_equal name "Level Control")}} +{{#if (is_server side)}} // User options for {{side}} plugin {{name}} #define EMBER_AF_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 254 #define EMBER_AF_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 #define EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE 0 {{/if}} -{{else if (isStrEqual name "Scenes")}} -{{#if (isServer side)}} +{{else if (is_str_equal name "Scenes")}} +{{#if (is_server side)}} // User options for {{side}} plugin {{name}} -// Cluster spec 1.4.8.2 -#ifdef CHIP_CONFIG_MAX_SCENES_PER_FABRIC -#define MATTER_SCENES_TABLE_SIZE CHIP_CONFIG_MAX_SCENES_PER_FABRIC -#else -#define MATTER_SCENES_TABLE_SIZE 16 -#endif {{/if}} {{#all_user_cluster_generated_attributes}} -{{#if (isStrEqual ../name clusterName)}} -{{#if (isStrEqual name "FeatureMap")}} - +{{#if (is_str_equal ../name clusterName)}} +{{#if (is_str_equal name "FeatureMap")}} // Scenes FeatureMap Attribute Toggle Scenes Name feature // App cluster specs 1.4.4 #define MATTER_CLUSTER_SCENE_NAME_SUPPORT_MASK 0x0001 #define MATTER_CLUSTER_SCENE_NAME_SUPPORT ({{asHex defaultValue 4}} & MATTER_CLUSTER_SCENE_NAME_SUPPORT_MASK) +// Scenes FeatureMap Table Size feature used for the MATTER_SCENES_TABLE_SIZE define +// App cluster specs 1.4.4.2 +#define MATTER_CLUSTER_TABLE_SIZE_SUPPORT_MASK 0x0001 +#define MATTER_CLUSTER_TABLE_SIZE_SUPPORT ({{asHex defaultValue 4}} & MATTER_CLUSTER_TABLE_SIZE_SUPPORT_MASK) +{{/if}} +{{#if (is_str_equal name "SceneTableSize")}} +// Cluster spec 1.4.8.7 +#define MATTER_SCENES_TABLE_SIZE {{defaultValue}} {{/if}} {{/if}} {{/all_user_cluster_generated_attributes}} diff --git a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml index eda59d9d3eabbc..0668f2dea4ae7c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml @@ -40,7 +40,7 @@ limitations under the License. WindowStatus AdminFabricIndex - AdminVendorId + AdminVendorId This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. @@ -48,7 +48,7 @@ limitations under the License. - + @@ -64,4 +64,9 @@ limitations under the License. + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml index c9e90052dc649d..a3c54b8c1d8c53 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml @@ -26,12 +26,15 @@ limitations under the License. This cluster provides information about an application running on a TV or media player device which is represented as an endpoint. VendorName VendorID - ApplicationName + ApplicationName ProductID Application Status ApplicationVersion - AllowedVendorList + + AllowedVendorList + +
diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml index d58dfca94375ee..7cca1ca7f19c28 100644 --- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml @@ -1,6 +1,6 @@ - MinLevel - MaxLevel + + MinLevel + + + + MaxLevel + + - IntrinsicBallastFactor - BallastFactorAdjustment + + IntrinsicBallastFactor + + + + BallastFactorAdjustment + + LampQuantity - LampType - LampManufacturer - LampRatedHours - LampBurnHours - LampAlarmMode - LampBurnHoursTripPoint + + LampType + + + + LampManufacturer + + + + LampRatedHours + + + + LampBurnHours + + + + LampAlarmMode + + + + LampBurnHoursTripPoint + +
diff --git a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml index 09ea471a0415f8..96b3be1377de41 100644 --- a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml @@ -31,7 +31,10 @@ limitations under the License. 0x001e BINDING_CLUSTER The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. - Binding + + Binding + +
diff --git a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml index f3b6192bbef2b3..3dd3e9d814aa02 100644 --- a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml @@ -27,13 +27,13 @@ limitations under the License. - + - + General Ethernet Network Diagnostics @@ -51,6 +51,7 @@ limitations under the License. TimeSinceReset Reception of this command SHALL reset the attributes: PacketRxCount, PacketTxCount, TxErrCount, CollisionCount, OverrunCount to 0 - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml index 454c6a8032897c..ce1289e71e529e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml @@ -41,14 +41,13 @@ limitations under the License. NameSupport - Command description for AddGroup - + @@ -86,7 +85,7 @@ limitations under the License. - + @@ -103,7 +102,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml index 7c31572e7aba34..90a335b46b1988 100644 --- a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml @@ -21,6 +21,29 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + @@ -40,10 +63,10 @@ limitations under the License. - + - IdleModeInterval - ActiveModeInterval + IdleModeDuration + ActiveModeDuration ActiveModeThreshold RegisteredClients @@ -54,6 +77,8 @@ limitations under the License. ClientsSupportedPerFabric + UserActiveModeTriggerHint + UserActiveModeTriggerInstruction Register a client to the end device diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml index 0747c2f55c9c8d..f9181a6edd5ca4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml @@ -33,6 +33,7 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml index 0c69e5eb349a76..aa8a5083a29903 100644 --- a/src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml @@ -28,7 +28,10 @@ limitations under the License. standards. As such, Nodes that visually or audibly convey information need a mechanism by which they can be configured to use a user’s preferred language, units, etc - ActiveLocale + + ActiveLocale + + SupportedLocales
diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 6b398976a387d3..c84b6db29c83aa 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -21,7 +21,7 @@ limitations under the License. CHIP Matter Orphan Clusters 0x0103 - 0xF001 + 0xFFF10001 @@ -1475,7 +1475,7 @@ limitations under the License. MA-heatcool - XCHIP + CHIP Matter Heating/Cooling Unit 0x0103 0x0300 @@ -1539,7 +1539,7 @@ limitations under the License. MA-thermostat - HA + CHIP Matter Thermostat 0x0103 0x0301 @@ -2036,7 +2036,7 @@ limitations under the License. CHIP Matter All-clusters-app Server Example 0x0103 - 0x0000 + 0xFFF10003 IDENTIFY_TIME @@ -2197,7 +2197,7 @@ limitations under the License. CHIP Matter Secondary Network Commissioning Device Type 0x0103 - 0xF002 + 0xFFF10002 diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml index e2841a1d6fb7d1..495160b10b473c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml @@ -1,6 +1,6 @@ + This cluster provides an interface for controlling the Input Selector on a media device such as a TV. InputList CurrentInput @@ -43,6 +43,7 @@ limitations under the License. Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. + @@ -53,8 +54,8 @@ limitations under the License. - - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml index 14365b605d9c92..5063f3241053bc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml @@ -49,6 +49,16 @@ limitations under the License. + + + + + + + + + + @@ -75,6 +85,13 @@ limitations under the License. + + + + + + + Network Commissioning CHIP @@ -111,6 +128,15 @@ limitations under the License. LastConnectErrorValue + + SupportedWiFiBands + + + SupportedThreadFeatures + + + ThreadVersion + Detemine the set of networks the device sees as available. @@ -170,10 +196,4 @@ limitations under the License. - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml index 0590efbe501263..d79cbb845c7827 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml @@ -71,14 +71,14 @@ limitations under the License. Sender is requesting attestation information from the receiver. - + An attestation information confirmation from the server. - - + + @@ -89,12 +89,12 @@ limitations under the License. A device attestation certificate (DAC) or product attestation intermediate (PAI) certificate from the server. - + Sender is requesting a certificate signing request (CSR) from the receiver. - + @@ -108,9 +108,9 @@ limitations under the License. Sender is requesting to add the new node operational certificates. - - - + + + @@ -127,7 +127,7 @@ limitations under the License. Response to AddNOC or UpdateNOC commands. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml index 347762b8d4cedd..994cdb78969a88 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml @@ -26,6 +26,6 @@ limitations under the License. true true - Sources + Sources diff --git a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml index 9d2ef812ac609d..7aa34bc6554b68 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml @@ -121,7 +121,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml index 7b60cff33629a1..bbd0e229338883 100644 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml @@ -31,6 +31,7 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml index 029de40ac06947..44a2669c8d018e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml @@ -37,10 +37,10 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. + SupportedModes CurrentMode - StartUpMode OnMode diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml index f663dce39ec4a7..2175e26ed9f257 100644 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml @@ -43,10 +43,10 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. + SupportedModes CurrentMode - StartUpMode OnMode diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index ff6769249dc4f0..43b63e67409b37 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -49,7 +49,7 @@ limitations under the License. SceneValid NameSupport LastConfiguredBy - SceneTableSize + SceneTableSize RemainingCapacity diff --git a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml index c9700fe14cccc4..018cab2932ea66 100644 --- a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml @@ -48,7 +48,10 @@ limitations under the License. InterconnectSmokeAlarm InterconnectCOAlarm ContaminationState - SmokeSensitivityLevel + + SmokeSensitivityLevel + + ExpiryDate diff --git a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml index fe558cb0ea0acc..2745b367d24f58 100644 --- a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml @@ -1,6 +1,6 @@